Error page Modified
parent
19f1031c37
commit
40b6b6dc48
|
|
@ -1,6 +1,6 @@
|
||||||
'use client' // Error components must be Client Components
|
'use client' // Error components must be Client Components
|
||||||
|
|
||||||
import { useEffect } from 'react'
|
// import { useEffect } from 'react'
|
||||||
|
|
||||||
export default function Error({
|
export default function Error({
|
||||||
error,
|
error,
|
||||||
|
|
@ -9,21 +9,20 @@ export default function Error({
|
||||||
error: Error & { digest?: string }
|
error: Error & { digest?: string }
|
||||||
reset: () => void
|
reset: () => void
|
||||||
}) {
|
}) {
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
// Log the error to an error reporting service
|
// // Log the error to an error reporting service
|
||||||
console.error(error)
|
// console.error(error)
|
||||||
}, [error])
|
// }, [error])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="mx-auto text-gray-700 flex flex-col justify-center items-center gap-y-10 mt-6">
|
||||||
<h2>Something went wrong!</h2>
|
<h2>مشکلی پیش آمده ...!</h2>
|
||||||
<button
|
<button
|
||||||
onClick={
|
className="text-white bg-blue hover:bg-blue50 p-2 w-fit rounded-md transition"
|
||||||
// Attempt to recover by trying to re-render the segment
|
onClick={() => reset()
|
||||||
() => reset()
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Try again
|
تلاش دوباره
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use client' // Error components must be Client Components
|
'use client' // Error components must be Client Components
|
||||||
|
|
||||||
import { useEffect } from 'react'
|
// import { useEffect } from 'react'
|
||||||
|
|
||||||
export default function Error({
|
export default function Error({
|
||||||
error,
|
error,
|
||||||
|
|
@ -9,21 +9,20 @@ export default function Error({
|
||||||
error: Error & { digest?: string }
|
error: Error & { digest?: string }
|
||||||
reset: () => void
|
reset: () => void
|
||||||
}) {
|
}) {
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
// Log the error to an error reporting service
|
// // Log the error to an error reporting service
|
||||||
console.error(error)
|
// console.error(error)
|
||||||
}, [error])
|
// }, [error])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="mx-auto text-gray-700 flex flex-col justify-center items-center gap-y-10 mt-6">
|
||||||
<h2>Something went wrong!</h2>
|
<h2>مشکلی پیش آمده ...!</h2>
|
||||||
<button
|
<button
|
||||||
onClick={
|
className="text-white bg-blue hover:bg-blue50 p-2 w-fit rounded-md transition"
|
||||||
// Attempt to recover by trying to re-render the segment
|
onClick={() => reset()
|
||||||
() => reset()
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
Try again
|
تلاش دوباره
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
'use client' // Error components must be Client Components
|
||||||
|
|
||||||
|
// import { useEffect } from 'react'
|
||||||
|
|
||||||
|
export default function Error({
|
||||||
|
error,
|
||||||
|
reset,
|
||||||
|
}: {
|
||||||
|
error: Error & { digest?: string }
|
||||||
|
reset: () => void
|
||||||
|
}) {
|
||||||
|
// useEffect(() => {
|
||||||
|
// // Log the error to an error reporting service
|
||||||
|
// console.error(error)
|
||||||
|
// }, [error])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="mx-auto text-gray-700 flex flex-col justify-center items-center gap-y-10 mt-6">
|
||||||
|
<h2>مشکلی پیش آمده ...!</h2>
|
||||||
|
<button
|
||||||
|
className="text-white bg-blue hover:bg-blue50 p-2 w-fit rounded-md transition"
|
||||||
|
onClick={() => reset()
|
||||||
|
}
|
||||||
|
>
|
||||||
|
تلاش دوباره
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue