2023-04-27 13:23:13 +02:00
|
|
|
"use client";
|
2023-04-03 13:39:51 +02:00
|
|
|
|
2023-04-27 13:23:13 +02:00
|
|
|
import { Boundary } from "#/ui/Boundary";
|
|
|
|
|
import { Button } from "#/ui/Button";
|
|
|
|
|
import React from "react";
|
2023-04-03 13:39:51 +02:00
|
|
|
|
|
|
|
|
export default function Error({ error, reset }: any) {
|
|
|
|
|
React.useEffect(() => {
|
2023-04-27 13:23:13 +02:00
|
|
|
console.log("logging error:", error);
|
2023-04-03 13:39:51 +02:00
|
|
|
}, [error]);
|
|
|
|
|
|
|
|
|
|
return (
|
2023-05-24 14:56:06 +02:00
|
|
|
<Boundary labels={["Home page Error UI"]} color="red">
|
2023-04-03 13:39:51 +02:00
|
|
|
<div className="space-y-4">
|
2023-05-24 14:56:06 +02:00
|
|
|
<div className="text-sm text-red-500 dark:text-red-500">
|
2023-04-03 13:39:51 +02:00
|
|
|
<strong className="font-bold">Error:</strong> {error?.message}
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Button onClick={() => reset()}>Try Again</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</Boundary>
|
|
|
|
|
);
|
|
|
|
|
}
|