feat(design-system): add not-found, error, loading pages
This commit is contained in:
parent
ac1d48bd2f
commit
99292bdb1d
25
web/src/app/error.tsx
Normal file
25
web/src/app/error.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function Error({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
|
||||
useEffect(() => { console.error('Unhandled error:', error); }, [error]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen items-center justify-center p-4" style={{ background: 'var(--nl-bg-canvas, #06070A)' }}>
|
||||
<div className="text-center">
|
||||
<h1 className="text-4xl font-bold" style={{ color: 'var(--nl-danger, #FF6E6E)' }}>Something went wrong</h1>
|
||||
<p className="mt-4 text-sm" style={{ color: 'var(--nl-text-secondary, #A5B1C7)' }}>
|
||||
{error.message || 'An unexpected error occurred.'}
|
||||
</p>
|
||||
<button
|
||||
onClick={reset}
|
||||
className="mt-6 inline-flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors"
|
||||
style={{ background: 'var(--nl-accent-primary, #5A8CFF)', color: '#fff' }}
|
||||
>
|
||||
Try again
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
13
web/src/app/loading.tsx
Normal file
13
web/src/app/loading.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
export default function Loading() {
|
||||
return (
|
||||
<div className="flex min-h-screen items-center justify-center" style={{ background: 'var(--nl-bg-canvas, #06070A)' }}>
|
||||
<div className="flex flex-col items-center gap-3">
|
||||
<div
|
||||
className="h-8 w-8 animate-spin rounded-full border-2 border-t-transparent"
|
||||
style={{ borderColor: 'var(--nl-accent-primary, #5A8CFF)', borderTopColor: 'transparent' }}
|
||||
/>
|
||||
<p className="text-sm" style={{ color: 'var(--nl-text-secondary, #A5B1C7)' }}>Loading...</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user