import { Loader2, XCircle } from 'lucide-react'; import { Badge } from '@/components/ui/badge'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { useServerHealth } from '@/lib/hooks/useServer'; import { useServerStore } from '@/stores/serverStore'; export function ServerStatus() { const { data: health, isLoading, error } = useServerHealth(); const serverUrl = useServerStore((state) => state.serverUrl); return ( Server Status
Server URL
{serverUrl}
{isLoading ? (
Checking connection...
) : error ? (
Connection failed: {error.message}
) : health ? (
Connected
{health.model_loaded || health.model_downloaded ? 'Model Ready' : 'No Model'} GPU: {health.gpu_available ? 'Available' : 'Not Available'} {health.vram_used_mb && ( VRAM: {health.vram_used_mb.toFixed(0)} MB )}
) : null}
); }