import { useRouter } from "next/navigation"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; import { Thermometer, Zap, Bell, ChevronRight } from "lucide-react"; import { cn } from "@/lib/utils"; import type { RoomStatus } from "@/lib/api"; interface Props { rooms: RoomStatus[]; loading?: boolean; } const statusConfig: Record = { ok: { label: "Healthy", dot: "bg-green-500", bg: "bg-green-500/10 text-green-400" }, warning: { label: "Warning", dot: "bg-amber-500", bg: "bg-amber-500/10 text-amber-400" }, critical: { label: "Critical", dot: "bg-destructive", bg: "bg-destructive/10 text-destructive" }, }; const roomLabels: Record = { "hall-a": "Hall A", "hall-b": "Hall B", "hall-c": "Hall C", }; export function RoomStatusGrid({ rooms, loading }: Props) { const router = useRouter(); return ( Room Status — Singapore DC01 {loading ? (
{Array.from({ length: 2 }).map((_, i) => ( ))}
) : rooms.length === 0 ? (
Waiting for room data...
) : (
{rooms.map((room) => { const s = statusConfig[room.status]; return ( ); })}
)}
); }