import type { LucideIcon } from "lucide-react"; import { Card, Group, Stack, Text, Paper } from "@mantine/core"; export interface StatItem { label: string; value: number | string; hint?: string; icon: LucideIcon; accent?: "default" | "amber" | "emerald" | "rose"; } const accentColors = { default: { bg: "var(--mantine-color-gray-1)", color: "var(--mantine-color-gray-6)" }, amber: { bg: "var(--mantine-color-yellow-1)", color: "var(--mantine-color-yellow-6)" }, emerald: { bg: "var(--freight-brand-muted)", color: "var(--freight-brand)" }, rose: { bg: "var(--mantine-color-red-1)", color: "var(--mantine-color-red-6)" }, }; export function BookingStatGrid({ items }: { items: StatItem[] }) { return ( {items.map((item) => { const Icon = item.icon; const accent = item.accent ?? "default"; const accentStyle = accentColors[accent]; return ( { e.currentTarget.style.boxShadow = "0 4px 12px rgba(34, 197, 94, 0.12)"; e.currentTarget.style.borderColor = "var(--freight-brand-border)"; }} onMouseLeave={(e) => { e.currentTarget.style.boxShadow = "none"; e.currentTarget.style.borderColor = "var(--mantine-color-gray-2)"; }} > {item.label} {item.value} {item.hint && ( {item.hint} )}
); })}
); }