mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-09-13 18:59:25 +00:00
18 lines
453 B
TypeScript
18 lines
453 B
TypeScript
import { StatusBadge, type StatusTone } from "@/components/status-badge";
|
|||
|
|
|
||
|
|
const phaseTones: Record<string, StatusTone> = {
|
||
|
|
Running: "success",
|
||
|
|
Succeeded: "success",
|
||
|
|
Failed: "error",
|
||
|
|
Pending: "warning",
|
||
|
|
Unknown: "neutral",
|
||
|
|
};
|
||
|
|
|
||
|
|
export function K8sPhaseBadge({ phase }: { phase?: string }) {
|
||
|
|
if (!phase) {
|
||
|
|
return <StatusBadge>Unknown</StatusBadge>;
|
||
|
|
}
|
||
|
|
|
||
|
|
return <StatusBadge tone={phaseTones[phase] ?? "neutral"}>{phase}</StatusBadge>;
|
||
|
|
}
|