"use strict";exports.id=24531,exports.ids=[24531],exports.modules={24531:(a,b,c)=>{c.r(b),c.d(b,{default:()=>l});var d=c(48249),e=c(67484),f=c(19099),g=c(75963),h=c(79465),i=c(91115),j=c(41090),k=c(20524);function l({params:a}){let b=(0,f.useRouter)(),c=(0,e.use)(a),l=c?.id,[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)(!0),[q,r]=(0,e.useState)(!1),s=async a=>{try{r(!0),await h.st(l,a),(0,i.Te)("Category updated successfully!"),b.push("/admin/categories")}catch(a){console.error("Error updating category:",a),(0,i.Qg)(Object(a).message||"An error occurred")}finally{r(!1)}};return o?(0,d.jsx)(j.Z,{padding:"lg",children:(0,d.jsx)("div",{className:"text-center py-12",children:(0,d.jsx)("p",{className:"text-[var(--muted-foreground)]",children:"Loading category..."})})}):m?(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-8",children:[(0,d.jsx)("h1",{className:"text-3xl font-bold text-[var(--foreground)]",children:"Edit Category"}),(0,d.jsx)("p",{className:"text-[var(--muted-foreground)] mt-2",children:"Update the category details below"})]}),(0,d.jsx)(g.H,{category:m,onSubmit:s,onCancel:()=>{b.push("/admin/categories")},isLoading:q})]}):(0,d.jsx)(j.Z,{padding:"lg",children:(0,d.jsxs)("div",{className:"text-center py-12",children:[(0,d.jsx)("p",{className:"text-[var(--muted-foreground)] mb-4",children:"Category not found"}),(0,d.jsx)(k.$,{onClick:()=>b.push("/admin/categories"),children:"Back to Categories"})]})})}}};