import { A } from '@solidjs/router'; import AdminShell from '~/components/AdminShell'; import { Users, Building2, Briefcase, Clock, Ticket, Receipt, Package, Megaphone, Shield, UserCog, FormInput, LayoutDashboard, BadgeCheck, ArrowUpRight, Activity, } from 'lucide-solid'; import type { Component } from 'solid-js'; type KpiCard = { label: string; value: string; href: string; icon: Component; color: string; // tailwind color name (e.g. 'blue') }; type ControlLink = { label: string; href: string; desc: string; icon: Component; iconBg: string; iconFg: string; }; const KPI: KpiCard[] = [ { label: 'Total Users', value: '—', href: '/admin/users', icon: Users, color: 'violet' }, { label: 'Companies', value: '—', href: '/admin/company', icon: Building2, color: 'blue' }, { label: 'Open Jobs', value: '—', href: '/admin/jobs', icon: Briefcase, color: 'amber' }, { label: 'Pending Approvals', value: '—', href: '/admin/approval', icon: Clock, color: 'orange' }, { label: 'Open Tickets', value: '—', href: '/admin/support', icon: Ticket, color: 'rose' }, { label: 'Invoices', value: '—', href: '/admin/invoice', icon: Receipt, color: 'teal' }, { label: 'Active Orders', value: '—', href: '/admin/order', icon: Package, color: 'sky' }, { label: 'Active Leads', value: '—', href: '/admin/leads', icon: Megaphone, color: 'pink' }, ]; // Tailwind doesn't tree-shake dynamic class names, so we map them explicitly const colorMap: Record = { violet: { chip: 'bg-violet-100', icon: 'text-violet-600', value: 'text-violet-700' }, blue: { chip: 'bg-blue-100', icon: 'text-blue-600', value: 'text-blue-700' }, amber: { chip: 'bg-amber-100', icon: 'text-amber-600', value: 'text-amber-700' }, orange: { chip: 'bg-orange-100', icon: 'text-orange-600', value: 'text-orange-700' }, rose: { chip: 'bg-rose-100', icon: 'text-rose-600', value: 'text-rose-700' }, teal: { chip: 'bg-teal-100', icon: 'text-teal-600', value: 'text-teal-700' }, sky: { chip: 'bg-sky-100', icon: 'text-sky-600', value: 'text-sky-700' }, pink: { chip: 'bg-pink-100', icon: 'text-pink-600', value: 'text-pink-700' }, }; const CONTROLS: ControlLink[] = [ { label: 'Internal Roles', href: '/admin/roles', desc: 'Permissions and access levels for internal staff.', icon: Shield, iconBg: 'bg-blue-50', iconFg: 'text-blue-600', }, { label: 'External Roles', href: '/admin/runtime-roles', desc: 'Modules, credits, and capabilities per external role.', icon: UserCog, iconBg: 'bg-violet-50', iconFg: 'text-violet-600', }, { label: 'Onboarding Flows', href: '/admin/onboarding-schemas', desc: 'Schema-driven onboarding forms per external role.', icon: FormInput, iconBg: 'bg-amber-50', iconFg: 'text-amber-600', }, { label: 'External Dashboards', href: '/admin/external-dashboard-management', desc: 'Sidebar, widgets, and runtimeConfig per external role.', icon: LayoutDashboard, iconBg: 'bg-teal-50', iconFg: 'text-teal-600', }, { label: 'Internal Dashboards', href: '/admin/internal-dashboard-management', desc: 'Home widgets and KPI panels for internal staff.', icon: LayoutDashboard, iconBg: 'bg-orange-50', iconFg: 'text-orange-600', }, { label: 'Approval Queue', href: '/admin/approval', desc: 'Review, approve, or reject pending action requests.', icon: BadgeCheck, iconBg: 'bg-rose-50', iconFg: 'text-rose-600', }, ]; export default function AdminDashboard() { return (
{/* ── Page header ── */}

Platform Overview

Real-time snapshot of the Nxtgauge platform.

Live
{/* ── KPI grid ── */}
{KPI.map((kpi) => { const Icon = kpi.icon; const c = colorMap[kpi.color]; return (

{kpi.value}

{kpi.label}

); })}
{/* ── Control Plane ── */}

Control Plane

{CONTROLS.length} modules
{CONTROLS.map((item) => { const Icon = item.icon; return (

{item.label}

{item.desc}

); })}
); }