"use client"; import { motion } from "framer-motion"; interface AlertCardProps { id: string; alert_type: string; severity: string; message: string; suggested_action?: string | null; created_at: string; onDismiss?: (id: string) => void; } function getSeverityStyle(severity: string) { const styles: Record = { low: { bg: "bg-blue-500/5", border: "border-blue-500/20", icon: "â„šī¸" }, medium: { bg: "bg-yellow-500/5", border: "border-yellow-500/20", icon: "âš ī¸" }, high: { bg: "bg-red-500/5", border: "border-red-500/20", icon: "🚨" }, critical: { bg: "bg-red-500/10", border: "border-red-500/30", icon: "🆘" }, }; return styles[severity] ?? styles.low; } export default function AlertCard({ id, alert_type, severity, message, suggested_action, created_at, onDismiss, }: AlertCardProps) { const style = getSeverityStyle(severity); const typeLabels: Record = { mood_decline: "Mood Decline", low_energy: "Low Energy", high_anxiety: "Elevated Anxiety", burnout_risk: "Burnout Risk", crisis: "Needs Attention", persistent_sadness: "Persistent Sadness", }; return (
{style.icon}
{typeLabels[alert_type] ?? alert_type} {new Date(created_at).toLocaleDateString()}

{message}

{suggested_action && (

💡 {suggested_action}

)}
{onDismiss && ( )}
); }