2025-12-27 17:40:36 +00:00
|
|
|
import { useNavigate } from 'react-router-dom';
|
2025-12-03 21:56:50 +00:00
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
|
import {
|
|
|
|
|
Card,
|
|
|
|
|
CardContent,
|
|
|
|
|
CardDescription,
|
|
|
|
|
CardHeader,
|
|
|
|
|
CardTitle,
|
|
|
|
|
} from '@/components/ui/card';
|
2026-01-13 18:47:57 +00:00
|
|
|
import {
|
|
|
|
|
Home,
|
|
|
|
|
RefreshCw,
|
|
|
|
|
AlertTriangle,
|
|
|
|
|
Mail,
|
|
|
|
|
Clock,
|
|
|
|
|
CheckCircle,
|
|
|
|
|
} from 'lucide-react';
|
2025-12-25 10:30:50 +00:00
|
|
|
import { useState } from 'react';
|
2025-12-03 21:56:50 +00:00
|
|
|
|
2025-12-25 10:30:50 +00:00
|
|
|
/**
|
|
|
|
|
* FE-PAGE-018: Improved 500 error page with helpful messages and recovery actions
|
|
|
|
|
*/
|
2025-12-03 21:56:50 +00:00
|
|
|
function ServerErrorPage() {
|
2025-12-25 10:30:50 +00:00
|
|
|
const navigate = useNavigate();
|
|
|
|
|
const [isRetrying, setIsRetrying] = useState(false);
|
|
|
|
|
|
|
|
|
|
const handleRefresh = async () => {
|
|
|
|
|
setIsRetrying(true);
|
|
|
|
|
// Wait a bit before reloading to show feedback
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
}, 500);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleGoHome = () => {
|
|
|
|
|
navigate('/dashboard');
|
2025-12-03 21:56:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
2026-02-07 15:07:09 +00:00
|
|
|
<div className="min-h-screen flex items-center justify-center bg-background p-4">
|
2025-12-25 10:30:50 +00:00
|
|
|
<div className="w-full max-w-2xl">
|
|
|
|
|
<Card className="text-center">
|
|
|
|
|
<CardHeader>
|
2026-02-07 15:07:09 +00:00
|
|
|
<div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10">
|
2026-02-08 23:14:40 +00:00
|
|
|
<AlertTriangle className="h-8 w-8 text-destructive dark:text-destructive" />
|
2025-12-25 10:30:50 +00:00
|
|
|
</div>
|
|
|
|
|
<CardTitle className="text-2xl">Erreur serveur</CardTitle>
|
|
|
|
|
<CardDescription>
|
|
|
|
|
Une erreur interne s'est produite. Notre équipe a été notifiée.
|
|
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-6">
|
2026-02-07 15:07:09 +00:00
|
|
|
<div className="text-6xl font-bold text-foreground">
|
2025-12-25 10:30:50 +00:00
|
|
|
500
|
|
|
|
|
</div>
|
2026-02-08 23:04:51 +00:00
|
|
|
<p className="text-muted-foreground dark:text-muted-foreground">
|
2026-01-13 18:47:57 +00:00
|
|
|
Nous nous excusons pour la gêne occasionnée. Notre équipe
|
|
|
|
|
technique a été automatiquement notifiée et travaille à résoudre
|
|
|
|
|
le problème.
|
2025-12-25 10:30:50 +00:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{/* Status Info */}
|
2026-02-07 15:07:09 +00:00
|
|
|
<div className="bg-muted/50 border border-border rounded-lg p-4">
|
aesthetic-improvements: align spacing to 8px grid (Action 11.2.1.3)
- Created automated script (scripts/align-8px-grid.py) to align all spacing to 8px grid
- Replaced non-8px-aligned spacing: gap-3/p-3/m-3 (12px) → gap-4/p-4/m-4 (16px), gap-5/p-5/m-5 (20px) → gap-6/p-6/m-6 (24px), gap-10/p-10/m-10 (40px) → gap-12/p-12/m-12 (48px), gap-20/p-20/m-20 (80px) → gap-24/p-24/m-24 (96px)
- Preserved: 4px values (gap-1, p-1, m-1) as they may be intentional fine-tuning, responsive breakpoints (sm:, md:, lg:), test files, documentation
- Modified files across all components to ensure consistent 8px grid alignment
- Action 11.2.1.3: Align all elements to 8px grid - COMPLETE
2026-01-16 10:50:46 +00:00
|
|
|
<div className="flex items-start gap-4 text-left">
|
2026-02-07 15:07:09 +00:00
|
|
|
<Clock className="h-5 w-5 text-muted-foreground mt-0.5" />
|
2025-12-25 10:30:50 +00:00
|
|
|
<div>
|
2026-02-07 15:07:09 +00:00
|
|
|
<p className="text-sm font-medium text-muted-foreground">
|
2025-12-25 10:30:50 +00:00
|
|
|
Que faire maintenant ?
|
|
|
|
|
</p>
|
2026-02-07 15:07:09 +00:00
|
|
|
<ul className="text-sm text-muted-foreground mt-2 space-y-1 list-disc list-inside">
|
2025-12-25 10:30:50 +00:00
|
|
|
<li>Attendez quelques instants et réessayez</li>
|
|
|
|
|
<li>Vérifiez votre connexion internet</li>
|
|
|
|
|
<li>Si le problème persiste, contactez le support</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Actions */}
|
|
|
|
|
<div className="flex flex-col sm:flex-row gap-2">
|
|
|
|
|
<Button
|
|
|
|
|
onClick={handleRefresh}
|
|
|
|
|
disabled={isRetrying}
|
|
|
|
|
className="flex-1"
|
|
|
|
|
>
|
|
|
|
|
<RefreshCw
|
|
|
|
|
className={`mr-2 h-4 w-4 ${isRetrying ? 'animate-spin' : ''}`}
|
|
|
|
|
/>
|
|
|
|
|
{isRetrying ? 'Réessai...' : 'Réessayer'}
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
onClick={handleGoHome}
|
|
|
|
|
variant="outline"
|
|
|
|
|
className="flex-1"
|
|
|
|
|
>
|
2025-12-13 02:34:34 +00:00
|
|
|
<Home className="mr-2 h-4 w-4" />
|
2025-12-25 10:30:50 +00:00
|
|
|
Retour au dashboard
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Help Section */}
|
|
|
|
|
<div className="border-t pt-4 text-left">
|
2026-02-07 15:07:09 +00:00
|
|
|
<p className="text-sm font-medium text-foreground mb-3">
|
2025-12-25 10:30:50 +00:00
|
|
|
Besoin d'aide ?
|
|
|
|
|
</p>
|
|
|
|
|
<div className="space-y-2">
|
2026-02-08 23:04:51 +00:00
|
|
|
<div className="flex items-center gap-2 text-sm text-muted-foreground dark:text-muted-foreground">
|
2026-02-07 15:07:09 +00:00
|
|
|
<CheckCircle className="h-4 w-4 text-success" />
|
2026-01-13 18:47:57 +00:00
|
|
|
<span>
|
|
|
|
|
L'erreur a été automatiquement signalée à notre équipe
|
|
|
|
|
</span>
|
2025-12-25 10:30:50 +00:00
|
|
|
</div>
|
2026-02-08 23:04:51 +00:00
|
|
|
<div className="flex items-center gap-2 text-sm text-muted-foreground dark:text-muted-foreground">
|
2026-01-16 10:40:13 +00:00
|
|
|
<Mail className="h-4 w-4 text-kodo-steel" />
|
2025-12-25 10:30:50 +00:00
|
|
|
<span>
|
|
|
|
|
Contactez le support si le problème persiste après plusieurs
|
|
|
|
|
tentatives
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Technical Details (Collapsible) */}
|
|
|
|
|
<details className="border-t pt-4 text-left">
|
2026-02-07 15:07:09 +00:00
|
|
|
<summary className="text-sm font-medium text-foreground cursor-pointer hover:text-kodo-text-main dark:hover:text-kodo-text-main">
|
2025-12-25 10:30:50 +00:00
|
|
|
Détails techniques
|
|
|
|
|
</summary>
|
2026-02-08 23:04:51 +00:00
|
|
|
<div className="mt-2 p-4 bg-muted rounded text-xs font-mono text-muted-foreground dark:text-muted-foreground">
|
2025-12-25 10:30:50 +00:00
|
|
|
<p>Code d'erreur: 500 Internal Server Error</p>
|
|
|
|
|
<p>Timestamp: {new Date().toISOString()}</p>
|
|
|
|
|
<p>User Agent: {navigator.userAgent}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</details>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
2025-12-03 21:56:50 +00:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
export default ServerErrorPage;
|