diff --git a/app/(dashboard)/error.tsx b/app/(dashboard)/error.tsx new file mode 100644 index 0000000..db3b0ce --- /dev/null +++ b/app/(dashboard)/error.tsx @@ -0,0 +1,42 @@ +"use client"; + +import { useEffect } from "react"; +import { Button } from "@/components/ui/button"; +import { AlertTriangle } from "lucide-react"; + +export default function DashboardError({ + error, + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + console.error("Dashboard error:", error); + }, [error]); + + return ( +
+ Something went wrong loading the dashboard. Your projects and videos are safe. +
+ {error.digest && ( ++ Error ID: {error.digest} +
+ )} ++ The page you're looking for doesn't exist or has been moved. +
++ The project you're looking for doesn't exist or you don't have access to it. +
++ Something went wrong with the video player. This could be due to a network issue or a problem with the video file. +
+ {error.digest && ( ++ Error ID: {error.digest} +
+ )} ++ The video you're looking for doesn't exist or has been deleted. +
++ An unexpected error occurred. We've been notified and are working to fix it. +
+ {error.digest && ( ++ Error ID: {error.digest} +
+ )} ++ We couldn't load this video. It may have been removed or the link might be incorrect. +
+ {error.digest && ( ++ Error ID: {error.digest} +
+ )} ++ The video you're looking for doesn't exist, has been removed, or the link may be expired. +
++ {isVideoContext + ? "The video player encountered an error. Try reloading or go back to the project." + : "An unexpected error occurred. Try resetting the component or reload the page."} +
+( + Component: React.ComponentType
,
+ errorBoundaryProps?: Omit