import{R as m,u as h,j as e,L as x}from"./app-C796L9fe.js";import{A as f,H as p}from"./AppLayout-R1ceE7OC.js";import{C as u,c as b,U as j,a as w}from"./useSwipeDrawer-n_5l3Iw6.js";import{M as g}from"./map-pin-D1AjAwMQ.js";import{S as v}from"./star-cjkbzkuH.js";import{U as N}from"./users-DkV5aUZM.js";function D({children:t,title:l}){const[r,n]=m.useState(!1),{auth:s}=h().props,o=[{name:"Ringkasan",icon:b,href:"/dashboard"},{name:"Profil Saya",icon:j,href:"/dashboard/profile"},{name:"Buku Alamat",icon:g,href:"/dashboard/addresses"},{name:"Pesanan Saya",icon:w,href:"/dashboard/orders"},{name:"Wishlist",icon:p,href:"/dashboard/wishlist"},{name:"Ulasan Saya",icon:v,href:"/dashboard/reviews"},{name:"Afiliasi & Komisi",icon:N,href:"/dashboard/affiliates"}],d=typeof window<"u"?window.location.pathname:"";return e.jsx(f,{children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[e.jsx("div",{className:"w-full lg:w-1/4 space-y-4",children:e.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm p-6 space-y-6",children:[e.jsxs("div",{onClick:()=>n(!r),className:`flex items-center justify-between cursor-pointer lg:cursor-default select-none transition-all duration-200 ${r?"pb-4 border-b border-slate-100":"pb-0 border-b-0 lg:pb-4 lg:border-b lg:border-slate-100"}`,children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-emerald-100 text-emerald-700 flex items-center justify-center font-bold text-lg overflow-hidden",children:s?.user?.avatar?e.jsx("img",{src:s.user.avatar,alt:s.user.name,className:"w-full h-full object-cover"}):s?.user?.name?s.user.name.charAt(0).toUpperCase():"U"}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-bold text-slate-800 text-sm",children:s?.user?.name||"Dashboard Akun"}),e.jsx("p",{className:"text-xs text-slate-400",children:"Atur profil & pesanan"})]})]}),e.jsx("div",{className:"lg:hidden text-slate-400",children:e.jsx(u,{size:18,className:`transition-transform duration-200 ${r?"rotate-180":""}`})})]}),e.jsx("nav",{className:`${r?"flex":"hidden"} lg:flex flex-col space-y-1`,children:o.map(a=>{const i=a.icon,c=d===a.href;return e.jsxs(x,{href:a.href,className:`flex items-center px-4 py-2.5 text-sm font-semibold rounded-xl transition ${c?"bg-emerald-600 text-white shadow-md shadow-emerald-600/20":"text-slate-650 hover:bg-slate-50 hover:text-emerald-600"}`,children:[e.jsx(i,{size:16,className:"mr-3"}),a.name]},a.name)})})]})}),e.jsx("div",{className:"flex-grow lg:w-3/4 space-y-6",children:e.jsxs("div",{className:"bg-white p-6 md:p-8 rounded-xl border border-slate-200 shadow-sm min-h-[500px]",children:[e.jsx("h2",{className:"text-2xl font-black text-slate-900 border-b border-slate-100 pb-4 mb-6",children:l}),t]})})]})})})}export{D};
