1 line
8.2 KiB
JavaScript
1 line
8.2 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5506],{16494:(e,t,a)=>{a.d(t,{A:()=>i});var s=a(95155),n=a(12115),r=a(12108),l=a(49903);function i(e){let{className:t=""}=e,[a,i]=(0,n.useState)(!1),[c,d]=(0,n.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l.$n,{variant:"secondary",size:"sm",className:t,onClick:()=>i(!0),children:"Sign Out"}),a&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-6",onClick:e=>{e.target===e.currentTarget&&i(!1)},children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"relative w-full max-w-md bg-surface-900 border border-surface-600 rounded-xl shadow-xl p-6",children:[(0,s.jsx)("h3",{className:"text-xl font-semibold text-white mb-2",children:"Sign out"}),(0,s.jsx)("p",{className:"text-text-muted mb-6",children:"Are you sure you want to sign out of your account?"}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,s.jsx)(l.$n,{variant:"ghost",onClick:()=>i(!1),children:"Cancel"}),(0,s.jsx)(l.$n,{variant:"danger",isLoading:c,onClick:async()=>{try{d(!0),await (0,r.signOut)({callbackUrl:"/"})}finally{d(!1)}},children:"Sign Out"})]})]})]})]})}},49903:(e,t,a)=>{a.d(t,{$n:()=>l,z9:()=>i});var s=a(95155),n=a(6874),r=a.n(n);function l(e){let{variant:t="primary",size:a="md",isLoading:n=!1,children:r,className:l="",disabled:i,...c}=e;return(0,s.jsx)("button",{className:"".concat({primary:"btn-primary",secondary:"btn-secondary",ghost:"btn-ghost",danger:"btn bg-red-500 hover:bg-red-600 text-white"}[t]," ").concat({sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}[a]," ").concat(l," ").concat(n?"opacity-75 cursor-wait":""),disabled:i||n,...c,children:n?(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"spinner w-3 h-3"}),"Loading..."]}):r})}function i(e){let{variant:t="primary",size:a="md",children:n,className:l="",href:i="#",...c}=e;return(0,s.jsx)(r(),{href:i,className:"".concat({primary:"btn-primary",secondary:"btn-secondary",ghost:"btn-ghost"}[t]," ").concat({sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}[a]," ").concat(l),...c,children:n})}a(12115)},95506:(e,t,a)=>{a.d(t,{AdminSidebar:()=>x,Navigation:()=>o});var s=a(95155),n=a(6874),r=a.n(n),l=a(35695),i=a(12115),c=a(12108),d=a(16494);function o(){var e,t;let[a,n]=(0,i.useState)(!1),o=(0,l.usePathname)(),{data:x,status:m}=(0,c.useSession)(),h=[{href:"/",label:"Home"},{href:"/projects",label:"Projects"},{href:"/crew",label:"Crew"},{href:"/blog",label:"Blog"},{href:"/faq",label:"FAQ"},{href:"/contact",label:"Contact"}],u="authenticated"===m?[...h,{href:"/admin",label:"Admin"}]:h;return((0,i.useEffect)(()=>{let e=e=>{let t=document.getElementById("navigation-panel"),s=document.getElementById("menu-button");a&&t&&s&&!t.contains(e.target)&&!s.contains(e.target)&&n(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[a]),(0,i.useEffect)(()=>{let e=e=>{"Escape"===e.key&&a&&n(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[a]),null==o?void 0:o.startsWith("/admin"))?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("nav",{className:"hidden md:flex fixed top-0 left-0 right-0 z-50 h-14 items-center border-b border-surface-500/60 bg-surface-900/90 px-4 backdrop-blur-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-6",children:[(0,s.jsx)(r(),{href:"/",className:"text-lg font-brand tracking-tight text-white",children:"Biohazard VFX"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[h.map(e=>{let t=o===e.href;return(0,s.jsx)(r(),{href:e.href,className:"text-sm font-medium transition-colors duration-200 ".concat(t?"text-white":"text-text-muted hover:text-text-secondary"),children:e.label},e.href)}),"authenticated"===m&&(0,s.jsx)(r(),{href:"/admin",className:"text-sm font-medium text-text-muted hover:text-text-secondary transition-colors duration-200",children:"Admin"})]})]}),(0,s.jsx)("div",{className:"ml-auto flex items-center gap-2",children:"authenticated"===m?(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:null==x||null==(e=x.user)?void 0:e.email}),(0,s.jsx)(d.A,{})]}):null})]}),(0,s.jsxs)("button",{id:"menu-button","aria-label":"Toggle menu","aria-expanded":a,"aria-controls":"navigation-panel",onClick:()=>n(!a),className:"fixed top-4 left-4 z-50 w-10 h-10 rounded-lg border border-surface-500/60 bg-surface-900/80 transition-all duration-200 md:hidden ".concat(a?"ring-1 ring-accent/30":""),children:[(0,s.jsx)("span",{className:"sr-only",children:"Open menu"}),(0,s.jsxs)("div",{className:"relative h-full w-full flex items-center justify-center",children:[(0,s.jsx)("span",{className:"block w-5 h-0.5 bg-white transition-all duration-200 ".concat(a?"rotate-45 translate-y-0.5":"-translate-y-0.5")}),(0,s.jsx)("span",{className:"block w-5 h-0.5 bg-white transition-all duration-200 absolute ".concat(a?"opacity-0":"opacity-100")}),(0,s.jsx)("span",{className:"block w-5 h-0.5 bg-white transition-all duration-200 ".concat(a?"-rotate-45 -translate-y-0.5":"translate-y-0.5")})]})]}),a&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/70 transition-opacity duration-200 md:hidden"}),(0,s.jsx)("nav",{id:"navigation-panel",className:"fixed left-0 top-0 z-50 h-full w-80 max-w-[90vw] border-r border-surface-500/60 bg-surface-900/95 transition-transform duration-200 ease-out md:hidden ".concat(a?"translate-x-0":"-translate-x-full"),children:(0,s.jsxs)("div",{className:"flex h-full flex-col pt-16",children:[(0,s.jsx)("div",{className:"px-5 pb-5 border-b border-surface-500/40",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-display tracking-tight text-white",children:"Biohazard VFX"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Visual Effects Studio"})]})}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-5",children:(0,s.jsx)("ul",{className:"space-y-1",children:u.map(e=>{let t=o===e.href;return(0,s.jsx)("li",{children:(0,s.jsx)(r(),{href:e.href,onClick:()=>n(!1),className:"block px-3 py-2 rounded text-sm font-medium transition-colors duration-150 ".concat(t?"text-white bg-surface-700":"text-text-muted hover:text-white hover:bg-surface-700"),children:e.label})},e.href)})})}),(0,s.jsx)("div",{className:"p-5 border-t border-surface-500/40",children:"authenticated"===m?(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"text-xs text-text-muted",children:(0,s.jsxs)("p",{children:["Signed in as ",null==x||null==(t=x.user)?void 0:t.email]})}),(0,s.jsx)(d.A,{})]}):(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["\xa9 ",new Date().getFullYear()," Biohazard VFX"]})})})]})})]})}function x(){let e=(0,l.usePathname)();return(0,s.jsx)("aside",{className:"w-60 h-screen fixed left-0 top-0 z-40",children:(0,s.jsxs)("div",{className:"h-full bg-surface-900/90 border-r border-surface-500/70 flex flex-col",children:[(0,s.jsx)("div",{className:"p-5 border-b border-surface-500/60",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-white leading-tight",children:"Admin Dashboard"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Biohazard VFX"})]})}),(0,s.jsx)("nav",{className:"p-3",children:(0,s.jsx)("ul",{className:"space-y-1",children:[{href:"/admin",label:"Dashboard"},{href:"/admin/projects",label:"Projects"},{href:"/admin/blog",label:"Blog"},{href:"/admin/team",label:"Team"},{href:"/admin/faq",label:"FAQs"},{href:"/admin/media",label:"Media"},{href:"/admin/assets",label:"Site Assets"}].map(t=>{let a=e===t.href;return(0,s.jsx)("li",{children:(0,s.jsx)(r(),{href:t.href,className:"block px-3 py-2 rounded text-sm transition-colors ".concat(a?"bg-surface-700 text-white":"text-text-muted hover:bg-surface-700 hover:text-white"),children:t.label})},t.href)})})}),(0,s.jsx)("div",{className:"mt-auto p-3 border-t border-surface-500/60",children:(0,s.jsx)(r(),{href:"/",className:"btn-secondary w-full inline-flex items-center justify-center gap-2 text-sm",title:"Return to site",children:"← Back to site"})})]})})}}}]); |