import{L as f}from"./Layout-BNWXhjq5.js";import{Z as y,i as c,r as n,c as b,o as h,a,b as o,d as g,t as d,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:c,Head:y},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 h(),b("div",null,[a(m,{title:r.$t(l.title)},null,8,["title"]),o("div",k,[o("form",{onSubmit:t[2]||(t[2]=g((...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:_(()=>[w(d(r.$t("Update")),1)]),_:1},8,["loading"])])],32)])])}const $=V(L,[["render",C]]);export{$ as default};
