mirror of
https://github.com/Tony0410/nextstep.git
synced 2026-05-25 05:41:39 +08:00
Features added: - Emergency Info Card: Full-screen emergency view with patient info - Refill Tracker: Track pill counts with auto-decrement on dose - Activity Feed: View caregiver activity with filtering - Symptom Tracker: Log symptoms with severity and offline sync - Print Views: Daily meds, appointments, doctor visit summaries - iCal Export: Calendar subscription for appointments - PDF Export: Medical summary for doctor visits - Calendar View: Monthly calendar for appointments - Appointment Preparation: Checklist for upcoming appointments - Medication Reminders: PWA push notifications with quiet hours Bug fixes: - Fix invite workflow: Register/login now properly redirect back - Add undo for doctor questions (can unmark "asked" questions) - Fix API route type annotations for Next.js 14 compatibility - Add Suspense boundary for useSearchParams in login/register Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
'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 (
|
|
<div className="bg-orange-50 border border-orange-200 rounded-lg p-4">
|
|
<div className="flex items-start gap-3">
|
|
<AlertTriangle className="w-5 h-5 text-orange-600 mt-0.5 flex-shrink-0" />
|
|
<div className="flex-1">
|
|
<p className="font-semibold text-orange-800">
|
|
{lowMeds.length === 1 ? 'Medication running low' : `${lowMeds.length} medications running low`}
|
|
</p>
|
|
<ul className="mt-1 space-y-1">
|
|
{lowMeds.map(med => (
|
|
<li key={med.id}>
|
|
<button
|
|
onClick={() => router.push(`/meds/${med.id}`)}
|
|
className="text-sm text-orange-700 hover:text-orange-900 hover:underline"
|
|
>
|
|
{med.name} - {med.pillCount} pills left
|
|
</button>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|