import { Badge } from '@/components/ui/badge'; import { Checkbox } from '@/components/ui/checkbox'; import { Role, KPICard } from './DashboardConfig'; interface RoleDashboardSectionProps { role: Role; kpis: Record; onKPIToggle: (kpi: KPICard, checked: boolean) => void; } const kpiCards: KPICard[] = [ 'Total Requests', 'Open Requests', 'Approved Requests', 'Rejected Requests', 'My Pending Actions', 'TAT Compliance', 'Delayed Workflows', 'Average Cycle Time' ]; const getRoleBadgeColor = (role: Role) => { switch (role) { case 'Initiator': return 'bg-blue-100 text-blue-800'; case 'Approver': return 'bg-green-100 text-green-800'; case 'Spectator': return 'bg-gray-100 text-gray-800'; default: return 'bg-gray-100 text-gray-800'; } }; export function RoleDashboardSection({ role, kpis, onKPIToggle }: RoleDashboardSectionProps) { return (

{role} Dashboard

{kpiCards.map((kpi) => (
onKPIToggle(kpi, checked === true)} />
))}
); }