'use client'; import { useEffect } from 'react'; import Link from 'next/link'; import { useDictionary } from '@/components/I18nProvider'; /** * Rendered when a page throws — in practice almost always * ImmichUnavailableError, since that is what the Immich client raises when the * server cannot answer. * * The wording deliberately does not name Immich or claim to know the cause. * Next.js strips error messages in production builds and replaces them with a * digest, so this component genuinely cannot tell an Immich outage from any * other server error — asserting one would be a guess shown to visitors. The * distinction that matters is already made structurally: notFound() renders * not-found.tsx, a throw renders this. */ export default function Error({ error, reset, }: { error: Error & { digest?: string }; reset: () => void; }) { const t = useDictionary(); useEffect(() => { console.error('[Folio] Page render failed:', error); }, [error]); return (

{t.error.errorTitle}

{t.error.errorText}

{t.common.backToGallery}
{error.digest && (

{t.error.reference(error.digest)}

)}
); }