"use strict";exports.id=95578,exports.ids=[11289,33670,95578],exports.modules={16309:(a,b,c)=>{c.r(b),c.d(b,{default:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(75963),h=c(79465),i=c(91115);function j(){let a=(0,f.useRouter)(),b=(0,f.useSearchParams)(),c=b.get("type")?.toUpperCase()||"COURSE",j="CONSULTATION"===c||"BLOG"===c||"PRODUCT"===c||"COURSE"===c?c:"COURSE",[k,l]=(0,e.useState)(!1),m=async b=>{try{l(!0),await h.zZ(b),(0,i.Te)("Category created successfully!");let c="CONSULTATION"===b.type?"/admin/categories?type=CONSULTATION":"/admin/categories";a.push(c)}catch(a){console.error("Error creating category:",a),(0,i.Qg)(Object(a).message||"An error occurred")}finally{l(!1)}};return(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:"Create New Category"}),(0,d.jsx)("p",{className:"text-[var(--muted-foreground)] mt-2",children:"Fill in the category details below"})]}),(0,d.jsx)(g.H,{defaultType:j,onSubmit:m,onCancel:()=>{a.push("CONSULTATION"===j?"/admin/categories?type=CONSULTATION":"/admin/categories")},isLoading:k})]})}},33670:(a,b,c)=>{c.d(b,{T:()=>g});var d=c(48249),e=c(67484),f=c(14113);let g=({label:a,error:b,helperText:c,className:g,id:h,variant:i="default",...j})=>{let k=(0,e.useId)(),l=h||k,m="marketing"===i;return(0,d.jsxs)("div",{className:"w-full",children:[a&&(0,d.jsx)("label",{htmlFor:l,className:m?"mb-1.5 block text-sm font-medium text-slate-800":"mb-1 block text-sm font-medium text-[var(--foreground)]",children:a}),(0,d.jsx)("textarea",{id:l,className:(0,f.xW)("w-full resize-y transition-colors focus:outline-none",m?"rounded-lg border border-slate-200 bg-white px-3 py-2.5 text-sm text-slate-900 shadow-none placeholder:text-slate-400 focus:border-secondary-800 focus:ring-2 focus:ring-secondary-900/15":"rounded-none border px-4 py-2 focus:ring-2 focus:ring-[var(--primary-500)] focus:border-transparent",!m&&(b?"border-[var(--error)] focus:ring-red-500":"border-[var(--border)]"),m&&b?"border-red-400 focus:border-red-500 focus:ring-red-500/20":"",m?"":"bg-[var(--input)] text-[var(--foreground)]",g),...j}),b&&(0,d.jsx)("p",{className:"mt-1 text-sm text-[var(--error)]",children:b}),c&&!b&&(0,d.jsx)("p",{className:"mt-1 text-sm text-[var(--muted-foreground)]",children:c})]})}}};