import { useInfrastructureNodes } from '@/hooks/useInfrastructureNodes'; import { UptimeObject } from '@/components/ui/UptimeObject'; import { Card, CardContent } from '@/components/ui/Card'; import { Loader } from '@/components/ui/Loader'; import { EmptyState } from '@/components/ui/EmptyState'; export default function UptimeWidget() { const { nodes, isLoading, error } = useInfrastructureNodes(); return (

État des Services & SLA

{/* 1. Gestion de l'erreur */} {error && ( )} {/* 2. Gestion du chargement */} {isLoading && !error && } {/* 3. Gestion de l'état vide */} {!isLoading && !error && nodes.length === 0 && ( )} {/* 4. Affichage des données */} {!isLoading && !error && nodes.length > 0 && ( {nodes.map((node) => ( ))} )}
); }