Files
imap-copier/web/src/components/StatusBadge.tsx
T
vasyansk 1a451f9dbb feat(web): React SPA with realtime task detail over WebSocket
Vite + React 19 + TS console-style operator UI: hash-routed Login,
Endpoints, Tasks, and TaskDetail (realtime accounts table over /ws,
Run gated on all accounts testing ok on both sides).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMHQTtnQtQqL8muAXHr9kd
2026-07-01 19:01:05 +07:00

14 lines
484 B
TypeScript

export function StatusBadge({ status }: { status: string }) {
const s = (status || 'pending').toLowerCase()
let cls = 'badge-pending'
if (s === 'ok' || s === 'done' || s === 'success') cls = 'badge-ok'
else if (s === 'fail' || s === 'failed' || s === 'error') cls = 'badge-fail'
else if (s === 'running' || s === 'testing' || s === 'in_progress') cls = 'badge-info'
return (
<span className={`badge ${cls}`}>
<span className="dot" />
{s}
</span>
)
}