"use client"; import { AlertTriangle, Info, Clock, Calendar } from "lucide-react"; import { MedicalAlert as MedicalAlertType } from "./types"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import Link from "next/link"; interface MedicalAlertProps { alert: MedicalAlertType; className?: string; showAppointmentButton?: boolean; } const alertConfig = { NO_AGENDAR: { icon: Info, text: "Información general", description: "No requiere cita médica inmediata", className: "bg-muted border-muted-foreground/20 text-muted-foreground", iconClassName: "text-muted-foreground" }, RECOMENDADO: { icon: Clock, text: "Consulta recomendada", description: "Se recomienda agendar una cita médica", className: "bg-yellow-50 border-yellow-200 text-yellow-800", iconClassName: "text-yellow-600" }, URGENTE: { icon: AlertTriangle, text: "Atención urgente", description: "Requiere atención médica inmediata", className: "bg-red-500 border-red-600 text-white", iconClassName: "text-white" } }; export const MedicalAlert = ({ alert, className, showAppointmentButton = true }: MedicalAlertProps) => { const config = alertConfig[alert]; const Icon = config.icon; const shouldShowButton = showAppointmentButton && (alert === "RECOMENDADO" || alert === "URGENTE"); return (
{config.text}
{config.description}
{shouldShowButton && ( )}
); };