"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { AreaChart, Area, XAxis, YAxis, Tooltip, ResponsiveContainer, CartesianGrid, PieChart, Pie, Cell, } from "recharts"; import { Building2, IndianRupee, TrendingUp, Users, QrCode, ScanLine, ArrowRight, } from "lucide-react"; import { api } from "@/lib/api"; import { inr } from "@/lib/utils"; const DONUT = ["#2563eb", "#10b981", "#f59e0b", "#8b5cf6", "#94a3b8"]; export default function AdminDashboard() { const [d, setD] = useState(null); const [rev, setRev] = useState(null); useEffect(() => { api("/admin/dashboard").then(setD).catch(() => {}); api("/admin/revenue").then(setRev).catch(() => {}); }, []); const trend = (d?.revenue_trend ?? []).map((t: any) => ({ label: t.month.slice(2), revenue: t.revenue })); return (

Platform Overview

VerifyPack — all organizations at a glance.

{/* KPI row 1 */}
} tint="bg-blue-50 text-blue-600" /> } tint="bg-emerald-50 text-emerald-600" /> } tint="bg-violet-50 text-violet-600" /> } tint="bg-amber-50 text-amber-500" />
{/* KPI row 2 — lifecycle + platform totals */}
} /> } />

Revenue Trend

inr(v)} />

Revenue by Plan

{(rev?.plan_breakdown ?? []).map((_: any, i: number) => )} inr(v)} />
{(rev?.plan_breakdown ?? []).map((p: any, i: number) => ( {p.plan} ))}
); } function Kpi({ label, value, sub, icon, tint }: any) { return (
{icon}
{label}
{value}
{sub}
); } function Mini({ label, value, color, icon }: any) { return (
{icon}{value.toLocaleString?.() ?? value}
{label}
); } function Quick({ href, label }: any) { return ( {label} ); }