import{L as f}from"./Layout-DIVdUaBZ.js";import{i as c,Z as b,r as a,c as h,a as i,b as r,d as y,t as m,w as g,o as _,e as w}from"./app-CK3cEAAe.js";import{T as x}from"./TextInput-DDvOh0mT.js";import{L as v}from"./LoadingButton-DQHYFAIm.js";import{_ as V}from"./FlashMessages-ByEdcHWZ.js";import"./moment-BywspGD9.js";import"./v4-SoommWqA.js";const L={metaInfo(){return{title:this.form.name}},components:{LoadingButton:v,TextInput:x,Link:c,Head:b},layout:f,props:{title:String,department:Object},remember:"form",data(){return{form:this.$inertia.form({name:this.department.name})}},methods:{update(){this.form.put(this.route("departments.update",this.department.id))},destroy(){confirm("Are you sure you want to delete this department?")&&this.$inertia.delete(this.route("departments.destroy",this.department.id))},restore(){confirm("Are you sure you want to restore this department?")&&this.$inertia.put(this.route("departments.restore",this.department.id))}}},k={class:"bg-white rounded-md shadow overflow-hidden max-w-3xl"},B={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},D={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex items-center"};function N(o,t,d,C,n,s){const l=a("Head"),p=a("text-input"),u=a("loading-button");return _(),h("div",null,[i(l,{title:o.$t(d.title)},null,8,["title"]),r("div",k,[r("form",{onSubmit:t[2]||(t[2]=y((...e)=>s.update&&s.update(...e),["prevent"]))},[r("div",B,[i(p,{modelValue:n.form.name,"onUpdate:modelValue":t[0]||(t[0]=e=>n.form.name=e),error:n.form.errors.name,class:"pr-6 pb-8 w-full lg:w-1/2",label:o.$t("Name")},null,8,["modelValue","error","label"])]),r("div",D,[r("button",{class:"text-red-600 hover:underline",tabindex:"-1",type:"button",onClick:t[1]||(t[1]=(...e)=>s.destroy&&s.destroy(...e))},m(o.$t("Delete Department")),1),i(u,{loading:n.form.processing,class:"btn-indigo ml-auto",type:"submit"},{default:g(()=>[w(m(o.$t("Update Department")),1)]),_:1},8,["loading"])])],32)])])}const $=V(L,[["render",N]]);export{$ as default};
