| 1234567891011121314151617181920212223242526272829 |
- import { Circle, Database, FileJson } from "lucide-react";
- import type { DataOrigin } from "@/lib/api/types";
- import { statusLabel } from "@/lib/status/status";
- export function StatusBadge({ status }: { status: unknown }) {
- const value = String(status || "unknown");
- return (
- <span className={`badge ${value}`}>
- <Circle size={10} fill="currentColor" />
- {statusLabel(value)}
- </span>
- );
- }
- export function DataOriginBadge({ origin }: { origin: DataOrigin | string }) {
- const label =
- origin === "production_db"
- ? "生产事实"
- : origin === "mixed_with_runtime_export"
- ? "混合回放"
- : "回放导出";
- const Icon = origin === "production_db" ? Database : FileJson;
- return (
- <span className={`badge ${origin}`}>
- <Icon size={13} />
- {label}
- </span>
- );
- }
|