import React, { ReactNode } from 'react'; import { AnimatedPage } from './AnimatedPage'; type Accent = 'yellow' | 'red' | 'orange'; // Déclinaisons par page d'erreur : 404 = jaune (univers Ghost), 403 = orange // (interdit), 500 = rouge (panne). Classes complètes (pas de concaténation : // le JIT Tailwind ne compilerait pas des classes construites dynamiquement). const ACCENTS: Record = { yellow: { glow: 'bg-yellow-400/10', box: 'from-yellow-400 to-orange-500', accentText: 'text-yellow-700 dark:text-yellow-400', }, orange: { glow: 'bg-orange-500/10', box: 'from-orange-400 to-red-500', accentText: 'text-orange-600 dark:text-orange-400', }, red: { glow: 'bg-red-500/10', box: 'from-red-500 to-rose-600', accentText: 'text-red-600 dark:text-red-500', }, }; interface ErrorPageShellProps { code: string; icon: ReactNode; title: string; titleAccent: string; description: string; accent?: Accent; actions?: ReactNode; } /** * Gabarit commun des pages d'erreur (404, 403, 500…) : icône lumineuse, * code géant, titre bicolore et actions — l'univers visuel de la page * « Dimension inconnue ». */ export const ErrorPageShell: React.FC = ({ code, icon, title, titleAccent, description, accent = 'yellow', actions, }) => { const colors = ACCENTS[accent]; return (
{icon}

{code}

{title} {titleAccent}

{description}

{actions && (
{actions}
)}
); };