mirror of
https://github.com/Tony0410/nextstep.git
synced 2026-05-25 13:51:40 +08:00
Add 11 major features for caregiver health management
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>
This commit is contained in:
50
src/components/medications/RefillAlert.tsx
Normal file
50
src/components/medications/RefillAlert.tsx
Normal file
@@ -0,0 +1,50 @@
|
||||
'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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user