import{m as f,c as y,w as x,a as e,b as p,u as s,l as v,d as w,p as k,g as a,e as m,i as u,v as c,o as n,t as i}from"./app-iLLm8RtX.js";import{_ as h}from"./Layout-C0f8t0-G.js";/* empty css            */const V={class:"py-6"},U={class:"max-w-2xl mx-auto sm:px-6 lg:px-8"},q={class:"bg-white shadow mb-6"},S={class:"px-6 py-4"},B={class:"flex justify-between items-center"},E={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},N={class:"p-6"},C={class:"grid grid-cols-1 gap-6"},D={key:0,class:"text-red-600 text-sm mt-1"},_={key:0,class:"text-red-600 text-sm mt-1"},j={key:0,class:"text-red-600 text-sm mt-1"},M={key:0,class:"text-red-600 text-sm mt-1"},O={key:0,class:"text-red-600 text-sm mt-1"},T={key:0,class:"text-red-600 text-sm mt-1"},$={class:"mt-6"},A=["disabled"],H={__name:"EditStudent",props:{errors:Object,student:Object,courses:Array},setup(d){const l=d,o=f({name:l.student.name,state_code:l.student.state_code,email:l.student.email,phone:l.student.phone,center:l.student.center,enrollment_date:l.student.enrollment_date}),g=()=>{o.put(`/admin/${l.student.id}`)},{processing:b}=o;return(F,t)=>(n(),y(h,null,{default:x(()=>[e("div",V,[e("div",U,[e("div",q,[e("div",S,[e("div",B,[t[7]||(t[7]=e("h1",{class:"text-2xl font-bold text-gray-900"},"Edit Student",-1)),p(s(v),{href:"/admin",class:"text-gray-600 hover:text-gray-900"},{default:x(()=>[...t[6]||(t[6]=[w("← Back to Dashboard",-1)])]),_:1})])])]),e("div",E,[e("div",N,[e("form",{onSubmit:k(g,["prevent"])},[e("div",C,[e("div",null,[t[8]||(t[8]=e("label",{class:"block text-sm font-medium text-gray-700"},"Name",-1)),a(e("input",{"onUpdate:modelValue":t[0]||(t[0]=r=>s(o).name=r),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),[[c,s(o).name]]),d.errors.name?(n(),m("div",D,i(d.errors.name),1)):u("",!0)]),e("div",null,[t[9]||(t[9]=e("label",{class:"block text-sm font-medium text-gray-700"},"State Code",-1)),a(e("input",{"onUpdate:modelValue":t[1]||(t[1]=r=>s(o).state_code=r),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),[[c,s(o).state_code]]),d.errors.state_code?(n(),m("div",_,i(d.errors.state_code),1)):u("",!0)]),e("div",null,[t[10]||(t[10]=e("label",{class:"block text-sm font-medium text-gray-700"},"Email",-1)),a(e("input",{"onUpdate:modelValue":t[2]||(t[2]=r=>s(o).email=r),type:"email",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500",required:""},null,512),[[c,s(o).email]]),d.errors.email?(n(),m("div",j,i(d.errors.email),1)):u("",!0)]),e("div",null,[t[11]||(t[11]=e("label",{class:"block text-sm font-medium text-gray-700"},"Phone",-1)),a(e("input",{"onUpdate:modelValue":t[3]||(t[3]=r=>s(o).phone=r),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),[[c,s(o).phone]]),d.errors.phone?(n(),m("div",M,i(d.errors.phone),1)):u("",!0)]),e("div",null,[t[12]||(t[12]=e("label",{class:"block text-sm font-medium text-gray-700"},"Center",-1)),a(e("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>s(o).center=r),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),[[c,s(o).center]]),d.errors.center?(n(),m("div",O,i(d.errors.center),1)):u("",!0)]),e("div",null,[t[13]||(t[13]=e("label",{class:"block text-sm font-medium text-gray-700"},"Enrollment Date",-1)),a(e("input",{"onUpdate:modelValue":t[5]||(t[5]=r=>s(o).enrollment_date=r),type:"date",class:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500",required:""},null,512),[[c,s(o).enrollment_date]]),d.errors.enrollment_date?(n(),m("div",T,i(d.errors.enrollment_date),1)):u("",!0)])]),e("div",$,[e("button",{type:"submit",disabled:s(b),class:"bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded disabled:opacity-50"},i(s(b)?"Updating...":"Update Student"),9,A)])],32)])])])])]),_:1}))}};export{H as default};
