'use client' import { AlertTriangle } from 'lucide-react' import { useRouter } from 'next/navigation' interface RefillAlertProps { medications: { id: string name: string pillCount: number | null refillThreshold: number | null }[] } export function RefillAlert({ medications }: RefillAlertProps) { const router = useRouter() const lowMeds = medications.filter( m => m.pillCount !== null && m.refillThreshold !== null && m.pillCount <= m.refillThreshold ) if (lowMeds.length === 0) { return null } return (
{lowMeds.length === 1 ? 'Medication running low' : `${lowMeds.length} medications running low`}