import{u as y,c as i,a as g,b as c,d as e,F as v,j as w,i as k,w as S,y as C,h as b,t as l,g as P,l as A}from"./app-kAt5lVqd.js";const B={class:"flex h-screen bg-gray-100"},D={class:"w-64 bg-gradient-to-b from-gray-900 to-gray-800 text-white flex flex-col shadow-2xl"},F={class:"flex-1 overflow-y-auto py-4"},L={class:"text-xl"},j={class:"p-4 border-t border-gray-700"},N={class:"flex items-center gap-3 mb-3"},O={class:"w-10 h-10 rounded-full bg-gradient-to-r from-orange-500 to-red-500 flex items-center justify-center font-bold"},V={class:"flex-1"},z={class:"font-medium text-sm"},E={class:"text-xs text-gray-400"},I={class:"flex-1 overflow-y-auto"},$={__name:"AdminLayout",setup(M){const _=A(),d=y(),r=i(()=>d.user);i(()=>{var t,a,o;return((o=(a=(t=r.value)==null?void 0:t.roles)==null?void 0:a[0])==null?void 0:o.name)==="super-admin"});const f=i(()=>{var t,a,o;const s=(o=(a=(t=r.value)==null?void 0:t.roles)==null?void 0:a[0])==null?void 0:o.name;return s==="super-admin"?[{path:"/admin/dashboard",icon:"📊",label:"Dashboard"},{path:"/admin/products",icon:"🍕",label:"Products"},{path:"/admin/orders",icon:"📦",label:"Orders"},{path:"/admin/payments",icon:"💳",label:"Payments"},{path:"/admin/users",icon:"👥",label:"Staff"},{path:"/admin/categories",icon:"📁",label:"Categories"},{path:"/admin/settings",icon:"⚙️",label:"Settings"}]:s==="admin"||s==="manager"?[{path:"/manager/dashboard",icon:"📊",label:"Dashboard"},{path:"/manager/products",icon:"🍕",label:"My Products"},{path:"/admin/orders",icon:"📦",label:"Orders"},{path:"/admin/payments",icon:"💳",label:"Payments"},{path:"/admin/users",icon:"👥",label:"Staff"}]:[]}),x=()=>{d.logout(),_.push("/login")};return(s,t)=>{var u,m,p,h;const a=b("router-link"),o=b("router-view");return c(),g("div",B,[e("aside",D,[t[0]||(t[0]=e("div",{class:"p-6 border-b border-gray-700"},[e("h1",{class:"text-2xl font-bold bg-gradient-to-r from-orange-400 to-red-500 bg-clip-text text-transparent"},"🍔 FoodDelivery"),e("p",{class:"text-sm text-gray-400 mt-1"},"Admin Panel")],-1)),e("nav",F,[(c(!0),g(v,null,w(f.value,n=>(c(),k(a,{key:n.path,to:n.path,class:C(["flex items-center gap-3 px-6 py-3 hover:bg-gray-700 transition-colors",{"bg-gray-700 border-l-4 border-orange-500":s.$route.path===n.path}])},{default:S(()=>[e("span",L,l(n.icon),1),e("span",null,l(n.label),1)]),_:2},1032,["to","class"]))),128))]),e("div",j,[e("div",N,[e("div",O,l((m=(u=r.value)==null?void 0:u.name)==null?void 0:m.charAt(0)),1),e("div",V,[e("p",z,l((p=r.value)==null?void 0:p.name),1),e("p",E,l((h=r.value)==null?void 0:h.email),1)])]),e("button",{onClick:x,class:"w-full px-4 py-2 bg-red-600 hover:bg-red-700 rounded-lg text-sm transition-colors"}," Logout ")])]),e("main",I,[P(o)])])}}};export{$ as default};
