module.exports=[91119,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(68114);let e=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("rounded-xl border border-slate-200 bg-white text-slate-950 shadow-sm",a),...c}));e.displayName="Card";let f=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("flex flex-col space-y-1.5 p-6",a),...c}));f.displayName="CardHeader";let g=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("h3",{ref:e,className:(0,d.cn)("font-semibold leading-none tracking-tight",a),...c}));g.displayName="CardTitle";let h=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("p",{ref:e,className:(0,d.cn)("text-sm text-slate-500",a),...c}));h.displayName="CardDescription";let i=c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("p-6 pt-0",a),...c}));i.displayName="CardContent",c.forwardRef(({className:a,...c},e)=>(0,b.jsx)("div",{ref:e,className:(0,d.cn)("flex items-center p-6 pt-0",a),...c})).displayName="CardFooter",a.s(["Card",0,e,"CardContent",0,i,"CardDescription",0,h,"CardHeader",0,f,"CardTitle",0,g])},79675,a=>{"use strict";let b=(0,a.i(64831).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);a.s(["Save",0,b],79675)},19107,a=>{"use strict";let b=(0,a.i(64831).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],19107)},71697,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(18697),f=a.i(91119),g=a.i(66718),h=a.i(6704),i=a.i(19107),j=a.i(79675),k=a.i(38246);a.s(["default",0,function(){let a=(0,d.useRouter)(),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)({name:"",slug:"",description:""}),p=async b=>{b.preventDefault(),m(!0);try{if(!(await fetch("/api/categories",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok)throw Error("Failed to create category");h.default.success("Category created successfully!"),a.push("/admin/categories"),a.refresh()}catch(a){h.default.error(a.message||"Something went wrong")}finally{m(!1)}};return(0,b.jsxs)("div",{className:"max-w-2xl mx-auto space-y-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)(e.Button,{variant:"ghost",size:"icon",asChild:!0,className:"shrink-0",children:(0,b.jsx)(k.default,{href:"/admin/categories",children:(0,b.jsx)(i.ArrowLeft,{className:"w-5 h-5"})})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Add Category"}),(0,b.jsx)("p",{className:"text-sm text-slate-500",children:"Create a new product category."})]})]}),(0,b.jsx)("form",{onSubmit:p,children:(0,b.jsxs)(f.Card,{children:[(0,b.jsxs)(f.CardHeader,{children:[(0,b.jsx)(f.CardTitle,{children:"Category Details"}),(0,b.jsx)(f.CardDescription,{children:"Basic information for the category."})]}),(0,b.jsxs)(f.CardContent,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-sm font-medium leading-none",children:"Name"}),(0,b.jsx)(g.Input,{required:!0,value:n.name,onChange:a=>{let b=a.target.value;o({...n,name:b,slug:b.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,"")})},placeholder:"e.g. Toothbrushes"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-sm font-medium leading-none",children:"Slug"}),(0,b.jsx)(g.Input,{required:!0,value:n.slug,onChange:a=>o({...n,slug:a.target.value}),placeholder:"e.g. toothbrushes"}),(0,b.jsx)("p",{className:"text-[0.8rem] text-slate-500",children:"The URL friendly name. Generated automatically."})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-sm font-medium leading-none",children:"Description"}),(0,b.jsx)("textarea",{className:"flex min-h-[80px] w-full rounded-md border border-slate-200 bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-indigo-500",value:n.description,onChange:a=>o({...n,description:a.target.value}),placeholder:"Category description (optional)"})]}),(0,b.jsx)("div",{className:"pt-4 flex justify-end",children:(0,b.jsxs)(e.Button,{type:"submit",disabled:l,className:"gap-2 bg-indigo-600 hover:bg-indigo-700",children:[(0,b.jsx)(j.Save,{className:"w-4 h-4"})," ",l?"Saving...":"Save Category"]})})]})]})})]})}])}];

//# sourceMappingURL=_11y4750._.js.map