feat(dashboards): add error and not-found pages for admin and tracker dashboards

This commit is contained in:
saravanakumardb1 2026-02-28 20:24:15 -08:00
parent 33160a5daa
commit c3885059cf
4 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,33 @@
'use client';
import { useEffect } from 'react';
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// TODO: send to telemetry once wired
}, [error]);
return (
<div className="flex min-h-screen items-center justify-center p-4">
<div className="mx-auto max-w-md text-center">
<div className="mb-4 text-5xl"></div>
<h2 className="mb-2 text-xl font-semibold">Something went wrong</h2>
<p className="mb-6 text-sm text-muted-foreground">
{error.message || 'An unexpected error occurred.'}
</p>
<button
onClick={reset}
className="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
>
Try again
</button>
</div>
</div>
);
}

View File

@ -0,0 +1,21 @@
import Link from 'next/link';
export default function NotFound() {
return (
<div className="flex min-h-screen items-center justify-center p-4">
<div className="mx-auto max-w-md text-center">
<div className="mb-4 text-6xl font-bold text-muted-foreground">404</div>
<h2 className="mb-2 text-xl font-semibold">Page not found</h2>
<p className="mb-6 text-sm text-muted-foreground">
The page you&apos;re looking for doesn&apos;t exist or has been moved.
</p>
<Link
href="/"
className="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
>
Go to Dashboard
</Link>
</div>
</div>
);
}

View File

@ -0,0 +1,33 @@
'use client';
import { useEffect } from 'react';
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// TODO: send to telemetry once wired
}, [error]);
return (
<div className="flex min-h-screen items-center justify-center p-4">
<div className="mx-auto max-w-md text-center">
<div className="mb-4 text-5xl"></div>
<h2 className="mb-2 text-xl font-semibold">Something went wrong</h2>
<p className="mb-6 text-sm text-muted-foreground">
{error.message || 'An unexpected error occurred.'}
</p>
<button
onClick={reset}
className="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
>
Try again
</button>
</div>
</div>
);
}

View File

@ -0,0 +1,21 @@
import Link from 'next/link';
export default function NotFound() {
return (
<div className="flex min-h-screen items-center justify-center p-4">
<div className="mx-auto max-w-md text-center">
<div className="mb-4 text-6xl font-bold text-muted-foreground">404</div>
<h2 className="mb-2 text-xl font-semibold">Page not found</h2>
<p className="mb-6 text-sm text-muted-foreground">
The page you&apos;re looking for doesn&apos;t exist or has been moved.
</p>
<Link
href="/"
className="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
>
Go Home
</Link>
</div>
</div>
);
}