mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 21:50:57 +00:00
37 lines
992 B
TypeScript
37 lines
992 B
TypeScript
import { KpiStrip, type KpiItem } from "@/components/page";
|
|
|
|
import type { OverviewKpiItem } from "./OverviewKpiCard";
|
|
|
|
/**
|
|
* Map the overview accent vocabulary onto brand / Mantine palette colors so the
|
|
* shared KpiStrip renders a flat tinted icon chip per cell — no gradients,
|
|
* gauges or sparklines.
|
|
*/
|
|
const ACCENT_COLOR: Record<string, string> = {
|
|
default: "edr-green",
|
|
emerald: "edr-green",
|
|
amber: "yellow",
|
|
rose: "red",
|
|
sky: "blue",
|
|
violet: "violet",
|
|
gold: "yellow",
|
|
orange: "orange",
|
|
};
|
|
|
|
interface OverviewKpiStripProps {
|
|
items: OverviewKpiItem[];
|
|
}
|
|
|
|
/** Clean KPI strip for the overview tabs — delegates to the shared KpiStrip. */
|
|
export function OverviewKpiStrip({ items }: OverviewKpiStripProps) {
|
|
const kpiItems: KpiItem[] = items.map((item) => ({
|
|
label: item.label,
|
|
value: item.value,
|
|
icon: item.icon,
|
|
hint: item.hint,
|
|
color: ACCENT_COLOR[item.accent ?? "default"] ?? "edr-green",
|
|
}));
|
|
|
|
return <KpiStrip items={kpiItems} />;
|
|
}
|