diff --git a/app/indaba/(ops)/dashboard/page.tsx b/app/indaba/(ops)/dashboard/page.tsx index f475362..6faed9d 100644 --- a/app/indaba/(ops)/dashboard/page.tsx +++ b/app/indaba/(ops)/dashboard/page.tsx @@ -119,6 +119,15 @@ export default async function DashboardPage({ stageCounts[b.onboarding_stage] = (stageCounts[b.onboarding_stage] ?? 0) + 1; } const total = businesses.length; + const linkCount = linksRes.count ?? 0; + const eventsUpcoming = eventsUpcomingRes.count ?? 0; + const intros = + "data" in introsRes && Array.isArray(introsRes.data) ? introsRes.data : []; + const introsPending = intros.filter((i) => !i.roy_approved).length; + const runs = (agentRunsRes.data ?? []) as AgentRun[]; + const brief = briefRes.data as Pick | null; + const flags = (flagsRes.data ?? []) as ComplianceFlag[]; + const regSignals = (regSignalsRes.data ?? []) as RegulatorySignal[]; const today = new Intl.DateTimeFormat("en-GB", { weekday: "long", day: "2-digit", @@ -131,6 +140,12 @@ export default async function DashboardPage({ const isBd = user.role === "bd"; const isCompliance = user.role === "compliance"; + const hour = new Date().getHours(); + const timeOfDay = + hour < 12 ? "Good morning" : hour < 18 ? "Good afternoon" : "Good evening"; + const firstName = user.name.split(" ")[0] ?? user.name; + const greeting = `${timeOfDay}, ${firstName}`; + return (
{flash ? (