import{BarChart3,CalendarDays,CircleHelp,ClipboardList,CreditCard,Headphones,House,LifeBuoy,LogOut,MessageSquare,Plus,ScanLine,Settings,ShieldCheck,Ticket,Users,WalletCards}from"lucide-react";import{Brand,DashboardHeader}from"./site-shell";
type Role="Buyer"|"Seller"|"Super Admin";
const icons={home:House,tickets:Ticket,events:CalendarDays,orders:ClipboardList,payouts:WalletCards,messages:MessageSquare,analytics:BarChart3,scan:ScanLine,support:LifeBuoy,users:Users,payments:CreditCard,trust:ShieldCheck,settings:Settings,help:CircleHelp};
const roleNav={Buyer:[{icon:"home",label:"Overview",href:"/dashboard/buyer"},{icon:"tickets",label:"My tickets",href:"/dashboard/buyer#tickets"},{icon:"orders",label:"Orders & receipts",href:"/dashboard/buyer#orders"},{icon:"messages",label:"Messages",href:"/messages"},{icon:"support",label:"Reports & support",href:"/help"}],Seller:[{icon:"home",label:"Overview",href:"/dashboard/seller"},{icon:"events",label:"Events",href:"/dashboard/seller#events"},{icon:"orders",label:"Orders",href:"/dashboard/seller#orders"},{icon:"scan",label:"Attendees & check-in",href:"/dashboard/seller#attendees"},{icon:"messages",label:"Buyer messages",href:"/messages"},{icon:"analytics",label:"Analytics",href:"/dashboard/seller#analytics"},{icon:"payouts",label:"Payouts & bank",href:"/dashboard/seller#payouts"},{icon:"support",label:"Admin requests",href:"/seller-support"}],"Super Admin":[{icon:"home",label:"Command center",href:"/dashboard/admin"},{icon:"orders",label:"Orders",href:"/dashboard/admin#orders"},{icon:"payments",label:"Payments & refunds",href:"/dashboard/admin#payments"},{icon:"events",label:"Events & moderation",href:"/dashboard/admin#events"},{icon:"users",label:"Users & sellers",href:"/dashboard/admin#users"},{icon:"payouts",label:"Payouts",href:"/dashboard/admin#payouts"},{icon:"support",label:"Customer reports",href:"/dashboard/admin#reports"},{icon:"trust",label:"Risk & compliance",href:"/dashboard/admin#risk"},{icon:"settings",label:"Settings",href:"/dashboard/admin#settings"}]};
export function DashboardShell({role,title,children}:{role:Role;title:string;children:React.ReactNode}){return <div className="dashboard-layout"><aside className="dash-sidebar"><Brand/>{role==="Seller"&&<a className="create-event-button" href="/sell"><Plus size={17}/> Create event</a>}<nav>{roleNav[role].map((n,i)=>{const Icon=icons[n.icon as keyof typeof icons];return <a className={i===0?"active":""} href={n.href} key={n.label}><Icon size={18}/><span>{n.label}</span>{n.label.includes("Messages")&&<b>3</b>}</a>})}</nav><div className="sidebar-bottom"><a href="/help"><Headphones size={18}/> Help center</a><a href="/"><LogOut size={18}/> Back to site</a></div></aside><main className="dash-main"><DashboardHeader title={title} role={role}/>{children}</main></div>}
