peppa/apps/web/lib/status.ts
Асель 28fbde4add PEP-38: console foundation — Tailwind v4, shadcn/ui components, dark theme, three-panel layout
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 16:21:43 +05:00

43 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Labels and colour tones of task and runner statuses, shared by badges, rows and the side panel.
export type Tone = "primary" | "ok" | "warn" | "info" | "danger" | "muted";
export const TASK_STATUS: Record<string, { label: string; tone: Tone }> = {
backlog: { label: "Бэклог", tone: "muted" },
proposing: { label: "Proposal", tone: "primary" },
awaiting_approval: { label: "Ждёт одобрения", tone: "primary" },
in_progress: { label: "В работе", tone: "info" },
review: { label: "Ревью", tone: "ok" },
done: { label: "Готово", tone: "ok" },
blocked: { label: "Блок", tone: "danger" },
};
export const SESSION_STATUS: Record<string, { label: string; tone: Tone }> = {
starting: { label: "запуск", tone: "info" },
running: { label: "работает", tone: "info" },
waiting_input: { label: "ждёт тебя", tone: "primary" },
idle: { label: "простаивает", tone: "muted" },
stalled: { label: "зависла?", tone: "warn" },
rate_limited: { label: "лимит", tone: "warn" },
done: { label: "завершена", tone: "ok" },
failed: { label: "упала", tone: "danger" },
};
/** Text colour per tone, e.g. for status dots. */
export const TONE_TEXT: Record<Tone, string> = {
primary: "text-primary",
ok: "text-ok",
warn: "text-warn",
info: "text-info",
danger: "text-destructive",
muted: "text-muted-foreground",
};
export const TONE_BG: Record<Tone, string> = {
primary: "bg-primary",
ok: "bg-ok",
warn: "bg-warn",
info: "bg-info",
danger: "bg-destructive",
muted: "bg-muted-foreground",
};