(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[581],{1279:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>g});var r=l(5155),s=l(9709),n=l(157);let i=(0,n.A)("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);var a=l(4815),c=l(286),d=l(4063),h=l(1920);let u=(0,n.A)("GalleryVertical",[["path",{d:"M3 2h18",key:"15qxfx"}],["rect",{width:"18",height:"12",x:"3",y:"6",rx:"2",key:"1439r6"}],["path",{d:"M3 22h18",key:"8prr45"}]]);var o=l(3349),x=l(6874),f=l.n(x),p=l(5695),j=l(7238),y=l(2100),m=l(2115);let b=[{href:"/admin",label:"Dashboard",icon:i},{href:"/admin/products",label:"Products",icon:a.A},{href:"/admin/users",label:"Users",icon:c.A},{href:"/admin/forum",label:"Forum",icon:d.A},{href:"/admin/events",label:"Events",icon:h.A},{href:"/admin/posts",label:"Posts",icon:u}];function g(e){let{children:t}=e,l=(0,p.usePathname)(),{user:n,logout:i}=(0,y.A)(),a=(0,p.useRouter)();return((0,m.useEffect)(()=>{n||a.push("/")},[n,a]),n)?(0,r.jsxs)(s.SidebarProvider,{children:[(0,r.jsxs)(s.Bx,{children:[(0,r.jsx)(s.Gh,{children:(0,r.jsxs)("div",{className:"flex items-center gap-2 p-2",children:[(0,r.jsx)(j.q,{}),(0,r.jsx)("span",{className:"text-lg font-semibold",children:"Pagal Toli"})]})}),(0,r.jsx)(s.Yv,{children:(0,r.jsx)(s.wZ,{children:b.map(e=>(0,r.jsx)(s.FX,{children:(0,r.jsx)(s.Uj,{asChild:!0,isActive:l===e.href,tooltip:e.label,children:(0,r.jsxs)(f(),{href:e.href,children:[(0,r.jsx)(e.icon,{}),(0,r.jsx)("span",{children:e.label})]})})},e.href))})}),(0,r.jsx)(s.CG,{children:(0,r.jsx)(s.wZ,{children:(0,r.jsx)(s.FX,{children:(0,r.jsxs)(s.Uj,{onClick:i,tooltip:"Logout",children:[(0,r.jsx)(o.A,{}),(0,r.jsx)("span",{children:"Logout"})]})})})})]}),(0,r.jsxs)(s.sF,{children:[(0,r.jsxs)("header",{className:"flex h-14 items-center gap-4 border-b bg-muted/40 px-6",children:[(0,r.jsx)(s.x2,{}),(0,r.jsx)("h1",{className:"flex-1 text-lg font-semibold md:text-2xl",children:"Admin Portal"})]}),(0,r.jsx)("main",{className:"flex-1 p-6",children:t})]})]}):null}},1920:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});let r=(0,l(157).A)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},4063:(e,t,l)=>{"use strict";l.d(t,{A:()=>r});let r=(0,l(157).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},4306:(e,t,l)=>{Promise.resolve().then(l.bind(l,1279))},6654:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return s}});let r=l(2115);function s(e,t){let l=(0,r.useRef)(null),s=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=l.current;e&&(l.current=null,e());let t=s.current;t&&(s.current=null,t())}else e&&(l.current=n(e,r)),t&&(s.current=n(t,r))},[e,t])}function n(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let l=e(t);return"function"==typeof l?l:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{var t=t=>e(e.s=t);e.O(0,[277,688,152,132,874,884,37,441,684,977],()=>t(4306)),_N_E=e.O()}]);