module.exports=[99165,a=>{"use strict";a.s(["adminInputCls",0,"w-full rounded-lg border border-[#d9e2f7] bg-white px-3.5 py-2.5 text-sm text-[#132b87] placeholder:text-[#a5b0cc] focus:outline-none focus:border-[#1f3fb8] focus:ring-2 focus:ring-[#1f3fb8]/15 transition","adminLabelCls",0,"block text-xs font-medium text-[#5a688d] mb-1.5"])},18068,a=>{"use strict";var b=a.i(87924),c=a.i(99165);function d({message:a}){return a?(0,b.jsx)("p",{className:"mt-1 text-xs text-red-600",role:"alert",children:a}):null}a.s(["AdminField",0,function({label:a,name:e,children:f,error:g}){return(0,b.jsxs)("label",{className:"block",htmlFor:e,children:[(0,b.jsx)("span",{className:c.adminLabelCls,children:a}),f,(0,b.jsx)(d,{message:g})]})},"FieldError",0,d])},26472,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(18068),e=a.i(99165);a.s(["default",0,function({action:a,initial:f,submitLabel:g}){let[h,i,j]=(0,c.useActionState)(a,void 0);return(0,b.jsxs)("form",{action:i,className:"rounded-2xl border border-[#d9e2f7] bg-white p-5 sm:p-6 space-y-5 max-w-2xl",children:[(0,b.jsx)(d.AdminField,{label:"Title",name:"title",error:h?.errors?.title?.[0],children:(0,b.jsx)("input",{id:"title",name:"title",required:!0,defaultValue:f?.title??"",className:e.adminInputCls})}),(0,b.jsx)(d.AdminField,{label:"Category",name:"category",error:h?.errors?.category?.[0],children:(0,b.jsx)("input",{id:"category",name:"category",required:!0,defaultValue:f?.category??"",className:e.adminInputCls})}),(0,b.jsx)(d.AdminField,{label:"Excerpt",name:"excerpt",error:h?.errors?.excerpt?.[0],children:(0,b.jsx)("textarea",{id:"excerpt",name:"excerpt",required:!0,rows:4,defaultValue:f?.excerpt??"",className:`${e.adminInputCls} resize-y`})}),f?.imageUrl?(0,b.jsxs)("div",{className:"rounded-xl border border-[#e9eefc] bg-[#f8faff] p-3",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-[#5a688d] mb-2",children:"Current image"}),(0,b.jsx)("img",{src:f.imageUrl,alt:f.title||"Blog image",className:"h-40 w-full rounded-lg object-cover"})]}):null,(0,b.jsx)(d.AdminField,{label:"Upload image",name:"image",children:(0,b.jsx)("input",{id:"image",name:"image",type:"file",accept:"image/jpeg,image/png,image/webp",className:e.adminInputCls})}),(0,b.jsx)("input",{type:"hidden",name:"imageUrl",defaultValue:f?.imageUrl??""}),(0,b.jsx)(d.AdminField,{label:"Sort order",name:"sortOrder",error:h?.errors?.sortOrder?.[0],children:(0,b.jsx)("input",{id:"sortOrder",name:"sortOrder",type:"number",min:0,defaultValue:f?.sortOrder??0,className:e.adminInputCls})}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("input",{type:"checkbox",name:"featured",defaultChecked:f?.featured??!1,className:"accent-[#1f3fb8]"}),"Featured story"]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("input",{type:"checkbox",name:"published",defaultChecked:f?.published??!0,className:"accent-[#1f3fb8]"}),"Published on website"]}),(0,b.jsx)(d.FieldError,{message:h?.errors?.published?.[0]}),h?.message&&(0,b.jsx)("p",{className:"text-sm text-red-600",role:"alert",children:h.message}),(0,b.jsx)("button",{type:"submit",disabled:j,className:"rounded-full bg-[#1f3fb8] px-6 py-2.5 text-sm font-semibold text-white hover:bg-[#18339a] disabled:opacity-60",children:j?"Saving...":g})]})}])}];

//# sourceMappingURL=app_admin__components_0nws-jr._.js.map