import { RepoStatus } from '../types'; interface StatusCardProps { status: RepoStatus | null; namespace: string; repo: string; loading?: boolean; } export function StatusCard({ status, namespace, repo, loading }: StatusCardProps) { const getStateColor = (state: string) => { switch (state) { case 'CONNECTED': return 'bg-green-500'; case 'DISCONNECTED': return 'bg-gray-500'; case 'ERROR': return 'bg-red-500'; default: return 'bg-gray-500'; } }; const getHealthColor = (stage: string) => { switch (stage) { case 'Running': return 'text-green-400'; case 'Sleeping': return 'text-yellow-400'; case 'Building': return 'text-blue-400'; default: return 'text-gray-400'; } }; const getHealthBg = (stage: string) => { switch (stage) { case 'Running': return 'bg-green-500/20'; case 'Sleeping': return 'bg-yellow-500/20'; case 'Building': return 'bg-blue-500/20'; default: return 'bg-gray-500/20'; } }; if (loading) { return (
); } return (
{namespace}/{repo}
{status?.stage || 'Unknown'} {status?.state || 'DISCONNECTED'}
Last updated: {status?.last_updated ? new Date(status.last_updated).toLocaleTimeString() : 'Never'}
); }