import React from 'react'; import { Card, CardContent, CardHeader, CardTitle, Button } from '@/components/ui/index'; import { Alert, AlertDescription } from '@/components/ui/index'; import { AlertCircle, CheckCircle, XCircle } from 'lucide-react'; interface CephHealthInfo { status: 'HEALTH_OK' | 'HEALTH_WARN' | 'HEALTH_ERR'; summary: string; details: string[]; } interface CephHealthWidgetProps { health: CephHealthInfo; onRefresh?: () => void; isLoading?: boolean; } export function CephHealthWidget({ health, onRefresh, isLoading, }: CephHealthWidgetProps) { const getStatusColor = () => { switch (health.status) { case 'HEALTH_OK': return 'text-green-500'; case 'HEALTH_WARN': return 'text-yellow-500'; case 'HEALTH_ERR': return 'text-red-500'; default: return 'text-gray-500'; } }; const getStatusIcon = () => { switch (health.status) { case 'HEALTH_OK': return ; case 'HEALTH_WARN': return ; case 'HEALTH_ERR': return ; default: return ; } }; return ( Ceph Health ↻ {getStatusIcon()} {health.status} {health.summary} {health.details.length > 0 && ( {health.details.map((detail, index) => ( {detail} ))} )} ); }
{health.summary}