'use client' import Link from 'next/link' import type { Route } from 'next' import { Zap, AlertTriangle, AlertCircle, Info, ChevronRight, CheckCircle2, } from 'lucide-react' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { cn } from '@/lib/utils' export type DashboardAction = { id: string severity: 'critical' | 'warning' | 'info' title: string description: string href: string roundId?: string roundType?: string count?: number } type SmartActionsProps = { actions: DashboardAction[] } const severityOrder: Record = { critical: 0, warning: 1, info: 2, } const severityConfig = { critical: { icon: AlertTriangle, iconClass: 'text-red-600', bgClass: 'bg-red-50 dark:bg-red-950/30', borderClass: 'border-l-red-500', }, warning: { icon: AlertCircle, iconClass: 'text-amber-600', bgClass: 'bg-amber-50 dark:bg-amber-950/30', borderClass: 'border-l-amber-500', }, info: { icon: Info, iconClass: 'text-blue-600', bgClass: 'bg-blue-50 dark:bg-blue-950/30', borderClass: 'border-l-blue-500', }, } export function SmartActions({ actions }: SmartActionsProps) { const sorted = [...actions].sort( (a, b) => severityOrder[a.severity] - severityOrder[b.severity] ) return (
Action Required {actions.length > 0 && ( {actions.length} )}
{sorted.length === 0 ? (

All caught up!

) : (
{sorted.map((action) => { const config = severityConfig[action.severity] const Icon = config.icon return (

{action.title}

{action.description}

) })}
)}
) }