"use client"; import { useState, useEffect } from "react"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Users, UserCheck, Calendar, CalendarCheck, CalendarX, DollarSign, TrendingUp, ArrowUpRight, ArrowDownRight, } from "lucide-react"; interface DashboardStats { total_users: number; active_users: number; total_bookings: number; upcoming_bookings: number; completed_bookings: number; cancelled_bookings: number; total_revenue: number; monthly_revenue: number; } export default function Dashboard() { const [stats, setStats] = useState(null); const [loading, setLoading] = useState(true); const [timePeriod, setTimePeriod] = useState("last_month"); useEffect(() => { // Simulate API call const fetchStats = async () => { setLoading(true); // Simulate network delay await new Promise((resolve) => setTimeout(resolve, 500)); // Mock API response const mockData: DashboardStats = { total_users: 3, active_users: 3, total_bookings: 6, upcoming_bookings: 6, completed_bookings: 0, cancelled_bookings: 0, total_revenue: 0, monthly_revenue: 0, }; setStats(mockData); setLoading(false); }; fetchStats(); }, []); const statCards = [ { title: "Total Users", value: stats?.total_users ?? 0, icon: Users, trend: "+12%", trendUp: true, }, { title: "Active Users", value: stats?.active_users ?? 0, icon: UserCheck, trend: "+8%", trendUp: true, }, { title: "Total Bookings", value: stats?.total_bookings ?? 0, icon: Calendar, trend: "+24%", trendUp: true, }, { title: "Upcoming Bookings", value: stats?.upcoming_bookings ?? 0, icon: CalendarCheck, trend: "+6", trendUp: true, }, { title: "Completed Bookings", value: stats?.completed_bookings ?? 0, icon: CalendarCheck, trend: "0%", trendUp: true, }, { title: "Cancelled Bookings", value: stats?.cancelled_bookings ?? 0, icon: CalendarX, trend: "0%", trendUp: false, }, { title: "Total Revenue", value: `$${stats?.total_revenue.toLocaleString() ?? 0}`, icon: DollarSign, trend: "+18%", trendUp: true, }, { title: "Monthly Revenue", value: `$${stats?.monthly_revenue.toLocaleString() ?? 0}`, icon: TrendingUp, trend: "+32%", trendUp: true, }, ]; return (
{/* Main Content */}
{/* Welcome Section */}

Welcome Back! Hammond

Here's an overview of your practice today

{loading ? (
) : ( <> {/* Stats Grid */}
{statCards.map((card, index) => { const Icon = card.icon; return (
{card.trendUp ? ( ) : ( )} {card.trend}

{card.title}

{card.value}

vs last month

); })}
)}
); }