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-01-16 00:56:54 +00:00
|
|
|
<div className="min-h-screen flex items-center justify-center bg-kodo-void dark:bg-kodo-ink p-4">
|
2025-12-25 10:30:50 +00:00
|
|
|
<div className="w-full max-w-2xl">
|
|
|
|
|
<Card className="text-center">
|
|
|
|
|
<CardHeader>
|
2026-01-16 00:59:31 +00:00
|
|
|
<div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-kodo-red/10 dark:bg-kodo-red/20">
|
2026-01-16 00:56:54 +00:00
|
|
|
<AlertTriangle className="h-8 w-8 text-kodo-red dark:text-kodo-red" />
|
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-01-16 00:56:54 +00:00
|
|
|
<div className="text-6xl font-bold text-kodo-text-main dark:text-kodo-text-main">
|
2025-12-25 10:30:50 +00:00
|
|
|
500
|
|
|
|
|
</div>
|
2026-01-16 00:56:54 +00:00
|
|
|
<p className="text-kodo-content-dim dark:text-kodo-content-dim">
|
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 */}
|
aesthetic-improvements: reduce decorative cyan in error and chat components (80/20 rule, batch 6)
- NotFoundPage: decorative icon background (bg-kodo-cyan/20 → bg-kodo-steel/20, icon text-kodo-cyan → text-kodo-steel)
- ServerErrorPage: informational status box (bg-kodo-cyan/10 → bg-kodo-steel/10, border-kodo-cyan → border-kodo-steel, icon/text text-kodo-cyan → text-kodo-steel)
- ChatRoom: empty state icon background (bg-kodo-cyan/10 → bg-kodo-steel/10, border-kodo-cyan/20 → border-kodo-steel/20, icon text-kodo-cyan → text-kodo-steel)
- PlaybackHeatmap: stats box background (bg-kodo-cyan/10 → bg-kodo-steel/10, text-kodo-cyan → text-kodo-steel)
- Total: ~4 files, ~5 instances replaced
- Preserved: Active/functional states (ChatInput drag active overlay, ChatRoom highlighted message, TrackFilters active filters badge, PlaylistBatchActions batch mode banner, PlaybackHeatmap intensity visualization - functional), semantic status indicators (TrackHistory updated action - semantic color)
- Action 11.3.1.3 in progress (sixth batch: error pages and chat components)
2026-01-16 10:15:52 +00:00
|
|
|
<div className="bg-kodo-steel/10 dark:bg-kodo-steel/20 border border-kodo-steel dark:border-kodo-steel rounded-lg p-4">
|
2025-12-25 10:30:50 +00:00
|
|
|
<div className="flex items-start gap-3 text-left">
|
aesthetic-improvements: reduce decorative cyan in error and chat components (80/20 rule, batch 6)
- NotFoundPage: decorative icon background (bg-kodo-cyan/20 → bg-kodo-steel/20, icon text-kodo-cyan → text-kodo-steel)
- ServerErrorPage: informational status box (bg-kodo-cyan/10 → bg-kodo-steel/10, border-kodo-cyan → border-kodo-steel, icon/text text-kodo-cyan → text-kodo-steel)
- ChatRoom: empty state icon background (bg-kodo-cyan/10 → bg-kodo-steel/10, border-kodo-cyan/20 → border-kodo-steel/20, icon text-kodo-cyan → text-kodo-steel)
- PlaybackHeatmap: stats box background (bg-kodo-cyan/10 → bg-kodo-steel/10, text-kodo-cyan → text-kodo-steel)
- Total: ~4 files, ~5 instances replaced
- Preserved: Active/functional states (ChatInput drag active overlay, ChatRoom highlighted message, TrackFilters active filters badge, PlaylistBatchActions batch mode banner, PlaybackHeatmap intensity visualization - functional), semantic status indicators (TrackHistory updated action - semantic color)
- Action 11.3.1.3 in progress (sixth batch: error pages and chat components)
2026-01-16 10:15:52 +00:00
|
|
|
<Clock className="h-5 w-5 text-kodo-steel dark:text-kodo-steel mt-0.5" />
|
2025-12-25 10:30:50 +00:00
|
|
|
<div>
|
aesthetic-improvements: reduce decorative cyan in error and chat components (80/20 rule, batch 6)
- NotFoundPage: decorative icon background (bg-kodo-cyan/20 → bg-kodo-steel/20, icon text-kodo-cyan → text-kodo-steel)
- ServerErrorPage: informational status box (bg-kodo-cyan/10 → bg-kodo-steel/10, border-kodo-cyan → border-kodo-steel, icon/text text-kodo-cyan → text-kodo-steel)
- ChatRoom: empty state icon background (bg-kodo-cyan/10 → bg-kodo-steel/10, border-kodo-cyan/20 → border-kodo-steel/20, icon text-kodo-cyan → text-kodo-steel)
- PlaybackHeatmap: stats box background (bg-kodo-cyan/10 → bg-kodo-steel/10, text-kodo-cyan → text-kodo-steel)
- Total: ~4 files, ~5 instances replaced
- Preserved: Active/functional states (ChatInput drag active overlay, ChatRoom highlighted message, TrackFilters active filters badge, PlaylistBatchActions batch mode banner, PlaybackHeatmap intensity visualization - functional), semantic status indicators (TrackHistory updated action - semantic color)
- Action 11.3.1.3 in progress (sixth batch: error pages and chat components)
2026-01-16 10:15:52 +00:00
|
|
|
<p className="text-sm font-medium text-kodo-steel dark:text-kodo-steel">
|
2025-12-25 10:30:50 +00:00
|
|
|
Que faire maintenant ?
|
|
|
|
|
</p>
|
2026-01-16 10:16:13 +00:00
|
|
|
<ul className="text-sm text-kodo-steel dark:text-kodo-steel 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-01-16 00:56:54 +00:00
|
|
|
<p className="text-sm font-medium text-kodo-text-main dark:text-kodo-text-main mb-3">
|
2025-12-25 10:30:50 +00:00
|
|
|
Besoin d'aide ?
|
|
|
|
|
</p>
|
|
|
|
|
<div className="space-y-2">
|
2026-01-16 00:56:54 +00:00
|
|
|
<div className="flex items-center gap-2 text-sm text-kodo-content-dim dark:text-kodo-content-dim">
|
|
|
|
|
<CheckCircle className="h-4 w-4 text-kodo-lime" />
|
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-01-16 00:56:54 +00:00
|
|
|
<div className="flex items-center gap-2 text-sm text-kodo-content-dim dark:text-kodo-content-dim">
|
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-01-16 00:56:54 +00:00
|
|
|
<summary className="text-sm font-medium text-kodo-text-main dark:text-kodo-text-main 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-01-16 00:56:54 +00:00
|
|
|
<div className="mt-2 p-3 bg-kodo-void dark:bg-kodo-graphite rounded text-xs font-mono text-kodo-content-dim dark:text-kodo-content-dim">
|
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;
|