mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
- Introduce dedicated error pages for dashboard and video routes - Add specific not-found pages for dashboard, projects, videos, and settings - Implement global `not-found.tsx` for general unhandled routes - Integrate root and dashboard layouts with ErrorBoundary and Suspense - Add new UI components: Accordion, Hover Card, Menubar, Navigation Menu, Select, Tabs - Update Navbar to utilize the new Navigation Menu component - Enhance `button` component with a `link` variant for better styling - Refine existing UI components (dialog, dropdown, input, etc.) - Update Tailwind config with new colors and animation extensions
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
import { Button } from "@/components/ui/button";
|
|
import { AlertTriangle } from "lucide-react";
|
|
|
|
export default function RootError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string };
|
|
reset: () => void;
|
|
}) {
|
|
useEffect(() => {
|
|
console.error("Root error:", error);
|
|
}, [error]);
|
|
|
|
return (
|
|
<div className="flex min-h-screen flex-col items-center justify-center gap-4 p-4">
|
|
<div className="flex flex-col items-center gap-2 text-center">
|
|
<AlertTriangle className="h-12 w-12 text-destructive" />
|
|
<h1 className="text-2xl font-bold">Something went wrong</h1>
|
|
<p className="text-muted-foreground max-w-md">
|
|
An unexpected error occurred. We've been notified and are working to fix it.
|
|
</p>
|
|
{error.digest && (
|
|
<p className="text-muted-foreground text-xs">
|
|
Error ID: {error.digest}
|
|
</p>
|
|
)}
|
|
</div>
|
|
<div className="flex gap-2">
|
|
<Button onClick={reset} variant="default">
|
|
Try again
|
|
</Button>
|
|
<Button onClick={() => window.location.href = "/"} variant="outline">
|
|
Go home
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|