diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 680597a..ad081fa 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -67,6 +67,7 @@ function Dashboard() { openCasesRes, newCasesRes, closedCasesRes, tasksTodayRes, hearingsTodayRes, recentCasesRes, recentInvRes, recentPayRes, + remindersRes, ] = await Promise.all([ supabase.from("trust_ledger_entries").select("entry_type, amount"), supabase.from("invoice_payments").select("amount, paid_on").gte("paid_on", monthStart).lte("paid_on", monthEnd), @@ -80,6 +81,13 @@ function Dashboard() { supabase.from("cases").select("id, case_number, title, status, updated_at, client:clients(name)").order("updated_at", { ascending: false }).limit(5), supabase.from("invoices").select("id, invoice_number, total, status, issue_date, client:clients(name)").order("created_at", { ascending: false }).limit(5), supabase.from("payment_requests").select("id, recipient_name, description, total_amount_cents, status, created_at, paid_at").order("created_at", { ascending: false }).limit(5), + supabase + .from("task_reminders") + .select("id, remind_at, recipient_email, note, task:tasks(id, title, case_id)") + .is("sent_at", null) + .gte("remind_at", new Date().toISOString()) + .order("remind_at", { ascending: true }) + .limit(5), ]); // Trust balance @@ -136,6 +144,7 @@ function Dashboard() { setRecentCases(recentCasesRes.data ?? []); setRecentInvoices(recentInvRes.data ?? []); setRecentPayments(recentPayRes.data ?? []); + setUpcomingReminders(remindersRes.data ?? []); setLoading(false); })(); }, [user?.id]);