import { A } from '@solidjs/router'; import AdminShell from '~/components/AdminShell'; import { Users, Building2, Briefcase, Clock, Ticket, Receipt, Package, Megaphone, Shield, UserCog, FormInput, LayoutDashboard, BadgeCheck, ArrowRight, } from 'lucide-solid'; import type { Component } from 'solid-js'; type KpiCard = { label: string; value: string; badge?: string; badgeColor?: string; href: string; icon: Component; accentColor: string; // full tailwind class for the left bar bg chipBg: string; chipFg: string; }; const KPI: KpiCard[] = [ { label: 'Total Users', value: '—', badge: '+0%', badgeColor: 'text-emerald-600 bg-emerald-50', href: '/admin/users', icon: Users, accentColor: 'bg-[#fd6216]', chipBg: 'bg-[#fd6216]/5', chipFg: 'text-[#fd6216]', }, { label: 'Total Revenue', value: '—', badge: 'Weekly', badgeColor: 'text-[#0a1d37] bg-slate-100', href: '/admin/invoice', icon: Receipt, accentColor: 'bg-[#0a1d37]', chipBg: 'bg-[#0a1d37]/5', chipFg: 'text-[#0a1d37]', }, { label: 'Active Roles', value: '—', badge: 'Live', badgeColor: 'text-amber-600 bg-amber-50', href: '/admin/runtime-roles', icon: Briefcase, accentColor: 'bg-[#fd6216]', chipBg: 'bg-amber-50', chipFg: 'text-amber-600', }, { label: 'Pending Approvals', value: '—', badge: 'Action Required', badgeColor: 'text-white bg-red-500', href: '/admin/approval', icon: Clock, accentColor: 'bg-[#fd6216]', chipBg: 'bg-red-50', chipFg: 'text-red-600', }, ]; // Activity chart data (placeholder heights) const ACTIVITY = [ { day: 'MON', h: 40 }, { day: 'TUE', h: 65 }, { day: 'WED', h: 95 }, { day: 'THU', h: 70 }, { day: 'FRI', h: 55 }, { day: 'SAT', h: 30 }, { day: 'SUN', h: 45 }, ]; const QUICK_ACTIONS = [ { label: 'Create New Role', href: '/admin/roles/create', icon: Shield }, { label: 'Configure Dashboard', href: '/admin/external-dashboard-management', icon: LayoutDashboard }, { label: 'Add Employee', href: '/admin/employees', icon: Users }, ]; const PIPELINE = [ { name: 'Candidate Roles', type: 'External Role', status: 'Active', statusBg: 'bg-emerald-50 text-emerald-600', progress: 85, color: 'bg-[#fd6216]' }, { name: 'Onboarding Flows', type: 'Schema Builder', status: 'Pending', statusBg: 'bg-amber-50 text-amber-600', progress: 42, color: 'bg-amber-400' }, { name: 'Dashboard Config', type: 'UI Config', status: 'Draft', statusBg: 'bg-slate-100 text-slate-500', progress: 12, color: 'bg-slate-400' }, ]; const CONTROL: Array<{ label: string; href: string; desc: string; icon: Component; iconBg: string; iconFg: string }> = [ { label: 'Internal Roles', href: '/admin/roles', desc: 'Permissions & 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 & 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 & runtimeConfig per role.', icon: LayoutDashboard, iconBg: 'bg-teal-50', iconFg: 'text-teal-600' }, { label: 'Internal Dashboards', href: '/admin/internal-dashboard-management', desc: 'Home widgets & 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 (
{/* ── KPI Cards ── */}
{KPI.map((kpi) => { const Icon = kpi.icon; return ( {/* Left accent bar */} {/* ── Activity Chart + Intelligence Hub ── */}
{/* Activity Chart */}

System Activity

Platform traffic & Tracecoin velocity

{ACTIVITY.map((d) => (
{d.day}
))}
{/* Intelligence Hub + System Health */}
{/* Intelligence Hub */}

Intelligence Hub

{QUICK_ACTIONS.map((a) => { const Icon = a.icon; return ( {a.label} ); })}
{/* Pipeline Status */}

Pipeline Status

{PIPELINE.map((p) => (

{p.name}

{p.type}

{p.status}

{p.progress}%

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

Control Plane

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

{item.label}

{item.desc}

); })}
); }