biohazard-vfx/.next/static/chunks/app/admin/page-b88180973663196c.js
Nicholai 98a4c8f7db
Some checks failed
Build and Push to Docker Hub / Push Docker image to Docker Hub (push) Has been cancelled
Build and Push Docker Image / build-and-push (push) Has been cancelled
Fixed uploading and database integration, slightly updated NAV and made admin functionality live
2025-08-16 11:46:04 -06:00

1 line
8.1 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{11656:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>h});var a=s(95155),l=s(12108),r=s(35695),c=s(12115),i=s(6874),n=s.n(i),d=s(32941);function m(e){let{label:t,value:s,icon:l,trend:r}=e;return(0,a.jsxs)("div",{className:"card",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[l&&(0,a.jsx)("div",{className:"text-2xl",children:l}),r&&(0,a.jsxs)("span",{className:"text-sm ".concat(r.isPositive?"text-green-400":"text-red-400"),children:[r.isPositive?"↑":"↓"," ",Math.abs(r.value),"%"]})]}),(0,a.jsx)("p",{className:"text-text-muted text-sm mb-1",children:t}),(0,a.jsx)("p",{className:"text-3xl font-bold text-white",children:s})]})}s(66766);var o=s(16494);function x(){let[e,t]=(0,c.useState)({projects:0,blogPosts:0,teamMembers:0,faqs:0});return(0,c.useEffect)(()=>{let e=JSON.parse(localStorage.getItem("biohazard_projects")||"[]"),s=JSON.parse(localStorage.getItem("biohazard_blog_posts")||"[]"),a=JSON.parse(localStorage.getItem("biohazard_team_members")||"[]"),l=JSON.parse(localStorage.getItem("biohazard_faqs")||"[]");t({projects:e.length||8,blogPosts:s.filter(e=>e.published).length,teamMembers:a.length||3,faqs:l.filter(e=>e.published).length||5})},[]),(0,a.jsxs)("div",{className:"mt-12",children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-white mb-6",children:"Quick Stats"}),(0,a.jsxs)(d.xA,{cols:4,children:[(0,a.jsx)(m,{label:"Total Projects",value:e.projects}),(0,a.jsx)(m,{label:"Published Posts",value:e.blogPosts}),(0,a.jsx)(m,{label:"Team Members",value:e.teamMembers}),(0,a.jsx)(m,{label:"FAQ Items",value:e.faqs})]})]})}function h(){var e;let{data:t,status:s}=(0,l.useSession)(),i=(0,r.useRouter)();return((0,c.useEffect)(()=>{"loading"!==s&&(t||i.push("/admin/login"))},[t,s,i]),"loading"===s)?(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,a.jsx)("div",{className:"spinner w-8 h-8"})}):t?(0,a.jsxs)("div",{children:[(0,a.jsx)(d.zY,{title:"Admin Dashboard",subtitle:"Welcome, ".concat(null==(e=t.user)?void 0:e.name),actions:(0,a.jsx)(o.A,{})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-6",children:[(0,a.jsxs)(n(),{href:"/admin/projects",className:"card card-hover",children:[(0,a.jsx)("div",{className:"flex items-center mb-2",children:(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Projects"})}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Manage portfolio projects"})]}),(0,a.jsxs)(n(),{href:"/admin/blog",className:"card card-hover",children:[(0,a.jsx)("div",{className:"flex items-center mb-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Blog Posts"})}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Create and edit blog posts"})]}),(0,a.jsxs)(n(),{href:"/admin/media",className:"card card-hover",children:[(0,a.jsx)("div",{className:"flex items-center mb-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Media Library"})}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Upload and manage files"})]}),(0,a.jsxs)(n(),{href:"/admin/team",className:"card card-hover",children:[(0,a.jsx)("div",{className:"flex items-center mb-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Team"})}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Manage team members"})]}),(0,a.jsxs)(n(),{href:"/admin/faq",className:"card card-hover",children:[(0,a.jsx)("div",{className:"flex items-center mb-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:"FAQs"})}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Manage frequently asked questions"})]}),(0,a.jsxs)("div",{className:"card opacity-50",children:[(0,a.jsx)("div",{className:"flex items-center mb-4",children:(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Settings"})}),(0,a.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})]})]}),(0,a.jsx)(x,{})]}):null}},16494:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var a=s(95155),l=s(12115),r=s(12108),c=s(49903);function i(e){let{className:t=""}=e,[s,i]=(0,l.useState)(!1),[n,d]=(0,l.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.$n,{variant:"secondary",size:"sm",className:t,onClick:()=>i(!0),children:"Sign Out"}),s&&(0,a.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,a.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm"}),(0,a.jsxs)("div",{className:"relative w-full max-w-md bg-surface-900 border border-surface-600 rounded-xl shadow-xl p-6",children:[(0,a.jsx)("h3",{className:"text-xl font-semibold text-white mb-2",children:"Sign out"}),(0,a.jsx)("p",{className:"text-text-muted mb-6",children:"Are you sure you want to sign out of your account?"}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(c.$n,{variant:"ghost",onClick:()=>i(!1),children:"Cancel"}),(0,a.jsx)(c.$n,{variant:"danger",isLoading:n,onClick:async()=>{try{d(!0),await (0,r.signOut)({callbackUrl:"/"})}finally{d(!1)}},children:"Sign Out"})]})]})]})]})}},32941:(e,t,s)=>{"use strict";s.d(t,{mc:()=>c,wn:()=>r,xA:()=>i,zY:()=>l});var a=s(95155);function l(e){let{title:t,subtitle:s,actions:l}=e;return(0,a.jsx)("div",{className:"mb-8",children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-4xl font-display tracking-tight text-white mb-2",children:t}),s&&(0,a.jsx)("p",{className:"text-text-muted text-lg max-w-3xl",children:s})]}),l&&(0,a.jsx)("div",{className:"flex items-center gap-3",children:l})]})})}function r(e){let{children:t,className:s=""}=e;return(0,a.jsx)("section",{className:"section-spacing ".concat(s),children:t})}function c(e){let{children:t,className:s=""}=e;return(0,a.jsx)("div",{className:"container-custom ".concat(s),children:t})}function i(e){let{children:t,cols:s=3,gap:l="md",className:r=""}=e;return(0,a.jsx)("div",{className:"grid ".concat({1:"grid-cols-1",2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}[s]," ").concat({sm:"gap-4",md:"gap-6",lg:"gap-8"}[l]," ").concat(r),children:t})}s(12115)},49903:(e,t,s)=>{"use strict";s.d(t,{$n:()=>c,z9:()=>i});var a=s(95155),l=s(6874),r=s.n(l);function c(e){let{variant:t="primary",size:s="md",isLoading:l=!1,children:r,className:c="",disabled:i,...n}=e;return(0,a.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-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[s]," ").concat(c," ").concat(l?"opacity-75 cursor-wait":""),disabled:i||l,...n,children:l?(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"spinner w-4 h-4"}),"Loading..."]}):r})}function i(e){let{variant:t="primary",size:s="md",children:l,className:c="",href:i="#",...n}=e;return(0,a.jsx)(r(),{href:i,className:"".concat({primary:"btn-primary",secondary:"btn-secondary",ghost:"btn-ghost"}[t]," ").concat({sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[s]," ").concat(c),...n,children:l})}s(12115)},66766:(e,t,s)=>{"use strict";s.d(t,{default:()=>l.a});var a=s(71469),l=s.n(a)},71469:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{default:function(){return n},getImageProps:function(){return i}});let a=s(88229),l=s(38883),r=s(33063),c=a._(s(51193));function i(e){let{props:t}=(0,l.getImgProps)(e,{defaultLoader:c.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,s]of Object.entries(t))void 0===s&&delete t[e];return{props:t}}let n=r.Image},89484:(e,t,s)=>{Promise.resolve().then(s.bind(s,11656))}},e=>{e.O(0,[6874,3063,6454,8441,5964,7358],()=>e(e.s=89484)),_N_E=e.O()}]);