'use client'; // File: components/reminder/ReminderHistory.tsx // แสดงประวัติ Reminder และ Escalation ของ Review Task (T050) import React from 'react'; import { Badge } from '@/components/ui/badge'; import { Clock, AlertTriangle, Bell } from 'lucide-react'; type ReminderType = 'DUE_SOON' | 'ON_DUE' | 'OVERDUE' | 'ESCALATION_L1' | 'ESCALATION_L2'; interface ReminderEntry { id: string; type: ReminderType; sentAt: string; recipient?: string; isDelivered?: boolean; } interface ReminderHistoryProps { reminders: ReminderEntry[]; isLoading?: boolean; } const TYPE_CONFIG: Record< ReminderType, { label: string; icon: React.ElementType; variant: 'default' | 'secondary' | 'destructive' | 'outline' } > = { DUE_SOON: { label: 'Due Soon', icon: Clock, variant: 'outline' }, ON_DUE: { label: 'Due Today', icon: Bell, variant: 'secondary' }, OVERDUE: { label: 'Overdue', icon: AlertTriangle, variant: 'destructive' }, ESCALATION_L1: { label: 'Escalation L1', icon: AlertTriangle, variant: 'destructive' }, ESCALATION_L2: { label: 'Escalation L2 (PM)', icon: AlertTriangle, variant: 'destructive' }, }; export function ReminderHistory({ reminders, isLoading }: ReminderHistoryProps) { if (isLoading) { return