'use client';

import { StateButton, StateActions, StateShell } from '@/components/app-shell/StateShell';
import { getClientShellMessages } from '@/lib/localization/client-messages';
import { useParams } from 'next/navigation';

export default function ErrorPage({
  reset,
}: {
  error: Error & { digest?: string };
  reset: () => void;
}) {
  const params = useParams<{ locale?: string }>();
  const messages = getClientShellMessages(params?.locale);

  return (
    <StateShell title={messages.states.errorTitle} body={messages.states.errorBody}>
      <StateActions>
        <StateButton onClick={reset}>{messages.states.retry}</StateButton>
      </StateActions>
    </StateShell>
  );
}
