32 lines
1000 B
TypeScript
32 lines
1000 B
TypeScript
"use client"; // الزامی برای صفحات خطا
|
||
|
||
import { useEffect } from "react";
|
||
|
||
export default function Error({
|
||
error,
|
||
reset,
|
||
}: {
|
||
error: Error;
|
||
reset: () => void;
|
||
}) {
|
||
useEffect(() => {
|
||
console.error(error); // لاگ کردن خطا برای بررسی
|
||
}, [error]);
|
||
|
||
return (
|
||
<div className="flex flex-col items-center justify-center min-h-screen p-4">
|
||
<h1 className="text-6xl font-bold text-white">اوپس!</h1>
|
||
<h2 className="text-xl font-semibold mt-4 text-neutral-50">مشکلی در سرور رخ داده است</h2>
|
||
<p className="text-neutral-300 mt-2 text-center max-w-md">
|
||
در حال حاضر امکان پردازش درخواست شما وجود ندارد. لطفاً دوباره تلاش کنید.
|
||
</p>
|
||
<button
|
||
onClick={() => reset()}
|
||
className="mt-6 px-6 py-2 bg-white text-blue-900 rounded-lg transition cursor-pointer"
|
||
>
|
||
تلاش مجدد
|
||
</button>
|
||
</div>
|
||
);
|
||
}
|