// @yakcloud/ui — 상태 데코레이터(순수 UI 분류). // ds-sdk enum(리터럴 유니온) → {kind:BadgeKind, label} 매핑. switch-case 만, I/O·로직 없음. import type { ClusterStatus, DeploymentStatus, ServiceStatusDTO } from "@yakcloud/ds-sdk"; // Primitives.Badge 의 kind 분류. export type BadgeKind = "active" | "prov" | "error" | "pending"; export function statusMeta(s: ClusterStatus): { kind: BadgeKind; label: string } { switch (s) { case "ACTIVE": return { kind: "active", label: "Active" }; case "ERROR": return { kind: "error", label: "오류" }; case "UPDATING": return { kind: "prov", label: "업데이트 중" }; case "DELETING": return { kind: "pending", label: "삭제 중" }; case "DELETED": return { kind: "pending", label: "삭제됨" }; default: return { kind: "prov", label: "Provisioning" }; } } export function deployStatusMeta(s: DeploymentStatus): { kind: BadgeKind; label: string } { switch (s) { case "RUNNING": return { kind: "active", label: "Running" }; case "FAILED": return { kind: "error", label: "Failed" }; case "STOPPED": return { kind: "pending", label: "Stopped" }; case "QUEUED": return { kind: "prov", label: "Queued" }; case "BUILDING": return { kind: "prov", label: "Building" }; default: return { kind: "prov", label: "Deploying" }; } } export function serviceStatusMeta(s: ServiceStatusDTO): { kind: BadgeKind; label: string } { switch (s) { case "READY": return { kind: "active", label: "실행 중" }; case "ERROR": return { kind: "error", label: "오류" }; case "DELETING": return { kind: "pending", label: "삭제 중" }; case "DELETED": return { kind: "pending", label: "삭제됨" }; default: return { kind: "prov", label: "준비 중" }; // REQUESTED / PROVISIONING } }