// ================================================================ // frontend/src/components/dashboard/InsightsGrid.tsx // ================================================================ /** * Insights Grid - Key metrics at a glance * * 2x2 grid of important metrics: savings, inventory, waste, deliveries. * Mobile-first design with large touch targets. */ import React from 'react'; import { Insights } from '../../api/hooks/newDashboard'; interface InsightsGridProps { insights: Insights; loading?: boolean; } const colorConfig = { green: { bg: 'bg-green-50', border: 'border-green-200', text: 'text-green-800', detail: 'text-green-600', }, amber: { bg: 'bg-amber-50', border: 'border-amber-200', text: 'text-amber-900', detail: 'text-amber-600', }, red: { bg: 'bg-red-50', border: 'border-red-200', text: 'text-red-900', detail: 'text-red-600', }, }; function InsightCard({ label, value, detail, color, }: { label: string; value: string; detail: string; color: 'green' | 'amber' | 'red'; }) { const config = colorConfig[color]; return (