4031ab680d
- Change missing extension env vars from throw to log.warn (graceful degradation) - Move initialized flag after all init steps complete - Add error.tsx and loading.tsx for dashboard error boundaries - Fix cron route auth header checks - Add ensureInitialized() to journal entry reverse and invoice mark-paid/sent routes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
730 B
TypeScript
28 lines
730 B
TypeScript
'use client'
|
|
|
|
import { useEffect } from 'react'
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
export default function DashboardError({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string }
|
|
reset: () => void
|
|
}) {
|
|
useEffect(() => {
|
|
console.error('[dashboard] Unhandled error:', error)
|
|
}, [error])
|
|
|
|
return (
|
|
<div className="flex flex-col items-center justify-center min-h-[50vh] gap-4">
|
|
<h2 className="text-xl font-semibold">Nagot gick fel</h2>
|
|
<p className="text-muted-foreground text-sm max-w-md text-center">
|
|
Ett oväntat fel uppstod. Försök igen eller kontakta support om problemet
|
|
kvarstår.
|
|
</p>
|
|
<Button onClick={reset}>Försök igen</Button>
|
|
</div>
|
|
)
|
|
}
|