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