import { DashboardLayout } from "@/components/layout/sidebar"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Activity, Calendar, CheckCircle2, Target, TrendingUp, Clock } from "lucide-react"; import { fetchDashboardStats } from "@/lib/data/stats"; // Force dynamic rendering to fetch fresh data from Supabase on each request export const dynamic = "force-dynamic"; const MISSION_STATEMENT = "Build an iOS empire that generates the cashflow to retire on our own terms, travel the world with Heidi, honor every family milestone in style, and prove that 53 is just the launchpad to life's greatest chapter."; export default async function DashboardPage() { // Fetch real stats from Supabase const stats = await fetchDashboardStats(); const kpiData = [ { title: "Active Tasks", value: String(stats.activeTasksCount), change: `of ${stats.totalTasksCount} total tasks`, icon: CheckCircle2, trend: "up" as const, }, { title: "Goals Progress", value: `${stats.goalsProgress}%`, change: "based on completed tasks", icon: Target, trend: "up" as const, }, { title: "Apps Built", value: String(stats.appsBuilt), change: `${stats.projectsCount} total projects`, icon: TrendingUp, trend: "up" as const, }, { title: "Year Progress", value: `${stats.yearProgress}%`, change: `Day ${stats.yearDay} of ${stats.yearTotalDays}`, icon: Clock, trend: "neutral" as const, }, ]; const recentActivity = [ { action: "Dashboard now uses live Supabase data", time: "Just now", type: "system" }, { action: "Connected to gantt-board database", time: "Recently", type: "system" }, { action: `${stats.activeTasksCount} active tasks tracked`, time: "Live", type: "task" }, { action: `${stats.projectsCount} projects monitored`, time: "Live", type: "project" }, ]; const upcomingEvents = [ { title: "Yearly Anniversary", date: "Feb 23", type: "personal" }, { title: "Grabbing Anderson's dogs", date: "Feb 26, 5:30 PM", type: "task" }, { title: "Contract Renewal Check", date: "Mar 2026", type: "work" }, ]; return (
{/* Mission Statement Banner */}

The Mission

{MISSION_STATEMENT}

{/* Header */}

Dashboard

Welcome back, Matt. Here's your mission overview.

{/* KPI Cards */}
{kpiData.map((kpi) => { const Icon = kpi.icon; return ( {kpi.title}
{kpi.value}

{kpi.change}

); })}
{/* Two Column Layout */}
{/* Recent Activity */} Recent Activity
{recentActivity.map((item, i) => (

{item.action}

{item.time}

))}
{/* Upcoming Events */} Upcoming Events
{upcomingEvents.map((event, i) => (

{event.title}

{event.date}

{event.type}
))}
{/* Mission Progress */} Mission Progress
Goals Progress (Completed Tasks) {stats.goalsProgress}% complete
iOS Apps Portfolio {stats.appsBuilt} apps built
Year Progress Day {stats.yearDay} of {stats.yearTotalDays}
); }