import{L as f}from"./Layout-BNWXhjq5.js";import{Z as c,i as b,r as a,c as h,o as y,a as i,b as r,d as g,t as m,w as _,e as w}from"./app-BhD6J0Va.js";import{T as x}from"./TextInput-CRQDtFka.js";import{L as v}from"./LoadingButton-BKJMdZnQ.js";import{_ as V}from"./FlashMessages-DW2Y2mP0.js";import"./moment-DeOISj6Y.js";import"./v4-SoommWqA.js";const L={metaInfo(){return{title:this.form.name}},components:{LoadingButton:v,TextInput:x,Link:b,Head:c},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 y(),h("div",null,[i(l,{title:o.$t(d.title)},null,8,["title"]),r("div",k,[r("form",{onSubmit:t[2]||(t[2]=g((...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:_(()=>[w(m(o.$t("Update Department")),1)]),_:1},8,["loading"])])],32)])])}const $=V(L,[["render",N]]);export{$ as default};
