1 line
8.3 KiB
JavaScript
1 line
8.3 KiB
JavaScript
try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="88132199-1f24-43df-a9ab-ca2aa1eb1a45",e._sentryDebugIdIdentifier="sentry-dbid-88132199-1f24-43df-a9ab-ca2aa1eb1a45")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{11656:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>h});var a=t(95155),l=t(12108),i=t(35695),n=t(12115),c=t(6874),r=t.n(c),d=t(32941);function o(e){let{label:s,value:t,icon:l,trend:i}=e;return(0,a.jsxs)("div",{className:"card",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[l&&(0,a.jsx)("div",{className:"text-xl",children:l}),i&&(0,a.jsxs)("span",{className:"text-xs ".concat(i.isPositive?"text-green-400":"text-red-400"),children:[i.isPositive?"↑":"↓"," ",Math.abs(i.value),"%"]})]}),(0,a.jsx)("p",{className:"text-text-muted text-xs mb-1",children:s}),(0,a.jsx)("p",{className:"text-2xl font-bold text-white",children:t})]})}t(29706);var m=t(16494);function x(){let[e,s]=(0,n.useState)({projects:0,blogPosts:0,teamMembers:0,faqs:0});return(0,n.useEffect)(()=>{let e=JSON.parse(localStorage.getItem("biohazard_projects")||"[]"),t=JSON.parse(localStorage.getItem("biohazard_blog_posts")||"[]"),a=JSON.parse(localStorage.getItem("biohazard_team_members")||"[]"),l=JSON.parse(localStorage.getItem("biohazard_faqs")||"[]");s({projects:e.length||8,blogPosts:t.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)(o,{label:"Total Projects",value:e.projects}),(0,a.jsx)(o,{label:"Published Posts",value:e.blogPosts}),(0,a.jsx)(o,{label:"Team Members",value:e.teamMembers}),(0,a.jsx)(o,{label:"FAQ Items",value:e.faqs})]})]})}function h(){var e;let{data:s,status:t}=(0,l.useSession)(),c=(0,i.useRouter)();return((0,n.useEffect)(()=>{"loading"!==t&&(s||c.push("/admin/login"))},[s,t,c]),"loading"===t)?(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,a.jsx)("div",{className:"spinner w-8 h-8"})}):s?(0,a.jsxs)("div",{children:[(0,a.jsx)(d.zY,{title:"Admin Dashboard",subtitle:"Welcome, ".concat(null==(e=s.user)?void 0:e.name),actions:(0,a.jsx)(m.A,{})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 gap-6",children:[(0,a.jsxs)(r(),{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)(r(),{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)(r(),{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)(r(),{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)(r(),{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,s,t)=>{"use strict";t.d(s,{A:()=>c});var a=t(95155),l=t(12115),i=t(12108),n=t(49903);function c(e){let{className:s=""}=e,[t,c]=(0,l.useState)(!1),[r,d]=(0,l.useState)(!1);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.$n,{variant:"secondary",size:"sm",className:s,onClick:()=>c(!0),children:"Sign Out"}),t&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-6",onClick:e=>{e.target===e.currentTarget&&c(!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)(n.$n,{variant:"ghost",onClick:()=>c(!1),children:"Cancel"}),(0,a.jsx)(n.$n,{variant:"danger",isLoading:r,onClick:async()=>{try{d(!0),await (0,i.signOut)({callbackUrl:"/"})}finally{d(!1)}},children:"Sign Out"})]})]})]})]})}},29706:(e,s,t)=>{"use strict";t.d(s,{default:()=>n});var a=t(95155),l=t(66766),i=t(12115);function n(e){let{src:s,alt:t="Image",placeholderText:n="Image Coming Soon",placeholderSize:c,...r}=e,[d,o]=(0,i.useState)(!1),{width:m,height:x,fill:h,sizes:u}=r,g=(0,i.useMemo)(()=>{let e="number"==typeof m?m:(null==c?void 0:c.width)||1200,s="number"==typeof x?x:(null==c?void 0:c.height)||(h?675:800),t=encodeURIComponent(n);return"https://placehold.co/".concat(e,"x").concat(s,"/111113/CCCCCC.png?text=").concat(t)},[m,x,h,c,n]),f=!s||""===s.trim()||d?g:s,b="string"==typeof f&&f.includes("placehold.co"),j="string"==typeof f&&f.startsWith("/images/");return(0,a.jsx)(l.default,{...r,src:f,alt:t,sizes:null!=u?u:h?"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw":void 0,unoptimized:b||j,onError:()=>o(!0)})}},32941:(e,s,t)=>{"use strict";t.d(s,{mc:()=>n,wn:()=>i,xA:()=>c,zY:()=>l});var a=t(95155);function l(e){let{title:s,subtitle:t,actions:l}=e;return(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-display tracking-tight text-white mb-2",children:s}),t&&(0,a.jsx)("p",{className:"text-text-muted text-base max-w-3xl",children:t})]}),l&&(0,a.jsx)("div",{className:"flex items-center gap-2",children:l})]})})}function i(e){let{children:s,className:t=""}=e;return(0,a.jsx)("section",{className:"section-spacing ".concat(t),children:s})}function n(e){let{children:s,className:t=""}=e;return(0,a.jsx)("div",{className:"w-full px-4 sm:px-6 lg:px-8 ".concat(t),children:s})}function c(e){let{children:s,cols:t=3,gap:l="md",className:i=""}=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"}[t]," ").concat({sm:"gap-3",md:"gap-4",lg:"gap-6"}[l]," ").concat(i),children:s})}t(12115)},45124:(e,s,t)=>{Promise.resolve().then(t.bind(t,11656))},49903:(e,s,t)=>{"use strict";t.d(s,{$n:()=>l});var a=t(95155);function l(e){let{variant:s="primary",size:t="md",isLoading:l=!1,children:i,className:n="",disabled:c,...r}=e;return(0,a.jsx)("button",{className:"".concat({primary:"btn-primary",secondary:"btn-secondary",ghost:"btn-ghost",danger:"btn bg-destructive text-destructive-foreground hover:bg-brand-primary"}[s]," ").concat({sm:"px-2 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-4 py-2 text-base"}[t]," ").concat(n," ").concat(l?"opacity-75 cursor-wait":""),disabled:c||l,...r,children:l?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"spinner w-3 h-3"}),"Loading..."]}):i})}t(6874),t(12115)}},e=>{e.O(0,[6874,6454,6766,4850,8441,2691,7358],()=>e(e.s=45124)),_N_E=e.O()}]); |