From 18f72973a4e054513ca34c832227ec86a8c1f2dc Mon Sep 17 00:00:00 2001 From: Pahan Sarathchandra Date: Tue, 21 May 2024 20:10:34 +0300 Subject: [PATCH] Rename Error Component --- src/app/admin/error.tsx | 27 --------------------------- src/app/error.tsx | 8 +++++--- 2 files changed, 5 insertions(+), 30 deletions(-) delete mode 100644 src/app/admin/error.tsx diff --git a/src/app/admin/error.tsx b/src/app/admin/error.tsx deleted file mode 100644 index 1fcc885..0000000 --- a/src/app/admin/error.tsx +++ /dev/null @@ -1,27 +0,0 @@ -"use client"; - -import { Button } from "@/components/ui/button"; -import { useEffect } from "react"; - -interface ErrorProps { - error: Error & { digest?: string }; - reset: () => void; -} - -const Error = ({ error, reset }: ErrorProps) => { - useEffect(() => { - // Optionally log the error to an error reporting service - console.error(error); - }, [error]); - - return ( -
-

Something went wrong!

- -
- ); -}; - -export default Error; diff --git a/src/app/error.tsx b/src/app/error.tsx index ac38076..11c5e63 100644 --- a/src/app/error.tsx +++ b/src/app/error.tsx @@ -3,13 +3,13 @@ import { Button } from "@/components/ui/button"; import { useEffect } from "react"; -export default function Error({ +const ErrorPage = ({ error, reset, }: { error: Error & { digest?: string }; reset: () => void; -}) { +}) => { useEffect(() => { // Optionally log the error to an error reporting service console.error(error); @@ -23,4 +23,6 @@ export default function Error({ ); -} +}; + +export default ErrorPage;