(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1060],{4532:(e,t,a)=>{Promise.resolve().then(a.bind(a,8838))},8838:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>u});var s=a(5155),i=a(2115),l=a(5695),n=a(1154),r=a(8027);function u(){let e=(0,l.useParams)(),[t,a]=(0,i.useState)(null),[u,c]=(0,i.useState)(!0),[d,f]=(0,i.useState)("");return((0,i.useEffect)(()=>{(null==e?void 0:e.slug)&&fetch("/api/admin/news/".concat(e.slug)).then(e=>e.json()).then(e=>{e.article?a({...e.article,is_featured:1===e.article.is_featured}):f("Article not found"),c(!1)}).catch(()=>{f("Failed to load article"),c(!1)})},[null==e?void 0:e.slug]),u)?(0,s.jsx)("div",{className:"flex items-center justify-center min-h-[40vh]",children:(0,s.jsx)(n.A,{size:28,className:"animate-spin text-primary"})}):d||!t?(0,s.jsx)("div",{className:"text-center text-red-400 py-20",children:d||"Not found"}):(0,s.jsx)(r.default,{mode:"edit",initialData:t})}}},e=>{var t=t=>e(e.s=t);e.O(0,[95,8027,8441,1684,7358],()=>t(4532)),_N_E=e.O()}]);