import{m as g,c as f,w as b,a as e,b as p,u as s,l as y,d as v,p as w,g as l,e as a,i as u,v as m,o as i,t as n}from"./app-iLLm8RtX.js";import{_ as h}from"./Layout-C0f8t0-G.js";/* empty css            */const k={class:"py-6"},_={class:"max-w-2xl mx-auto sm:px-6 lg:px-8"},C={class:"bg-white shadow mb-6"},V={class:"px-6 py-4"},N={class:"flex justify-between items-center"},B={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},D={class:"p-6"},U={class:"grid grid-cols-1 gap-6"},q={key:0,class:"text-red-600 text-sm mt-1"},M={key:0,class:"text-red-600 text-sm mt-1"},j={key:0,class:"text-red-600 text-sm mt-1"},S={key:0,class:"text-red-600 text-sm mt-1"},T={class:"mt-6"},A=["disabled"],$={__name:"CreateCourse",props:{errors:Object},setup(r){const o=g({name:"",description:"",price:"",duration_months:""}),x=()=>{o.post("/admin/courses/store")},{processing:c}=o;return(E,t)=>(i(),f(h,null,{default:b(()=>[e("div",k,[e("div",_,[e("div",C,[e("div",V,[e("div",N,[t[5]||(t[5]=e("h1",{class:"text-2xl font-bold text-gray-900"},"Add New Course",-1)),p(s(y),{href:"/admin/courses/index",class:"text-gray-600 hover:text-gray-900"},{default:b(()=>[...t[4]||(t[4]=[v("← Back to Courses",-1)])]),_:1})])])]),e("div",B,[e("div",D,[e("form",{onSubmit:w(x,["prevent"])},[e("div",U,[e("div",null,[t[6]||(t[6]=e("label",{class:"block text-sm font-medium text-gray-700"},"Course Name",-1)),l(e("input",{"onUpdate:modelValue":t[0]||(t[0]=d=>s(o).name=d),type:"text",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500",required:""},null,512),[[m,s(o).name]]),r.errors.name?(i(),a("div",q,n(r.errors.name),1)):u("",!0)]),e("div",null,[t[7]||(t[7]=e("label",{class:"block text-sm font-medium text-gray-700"},"Description",-1)),l(e("textarea",{"onUpdate:modelValue":t[1]||(t[1]=d=>s(o).description=d),rows:"3",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"},null,512),[[m,s(o).description]]),r.errors.description?(i(),a("div",M,n(r.errors.description),1)):u("",!0)]),e("div",null,[t[8]||(t[8]=e("label",{class:"block text-sm font-medium text-gray-700"},"Price (₦)",-1)),l(e("input",{"onUpdate:modelValue":t[2]||(t[2]=d=>s(o).price=d),type:"number",step:"0.01",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500",required:""},null,512),[[m,s(o).price]]),r.errors.price?(i(),a("div",j,n(r.errors.price),1)):u("",!0)]),e("div",null,[t[9]||(t[9]=e("label",{class:"block text-sm font-medium text-gray-700"},"Duration (Months)",-1)),l(e("input",{"onUpdate:modelValue":t[3]||(t[3]=d=>s(o).duration_months=d),type:"number",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500",required:""},null,512),[[m,s(o).duration_months]]),r.errors.duration_months?(i(),a("div",S,n(r.errors.duration_months),1)):u("",!0)])]),e("div",T,[e("button",{type:"submit",disabled:s(c),class:"bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded disabled:opacity-50"},n(s(c)?"Creating...":"Create Course"),9,A)])],32)])])])])]),_:1}))}};export{$ as default};
