import{L as f}from"./Layout-DIVdUaBZ.js";import{i as y,Z as c,r as n,c as b,a,b as r,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,priority:Object},remember:"form",data(){return{form:this.$inertia.form({name:this.priority.name})}},created(){},methods:{update(){this.form.put(this.route("priorities.edit",this.priority.id))},destroy(){confirm("Are you sure you want to delete this priority?")&&this.$inertia.delete(this.route("priorities.destroy",this.priority.id))},restore(){confirm("Are you sure you want to restore this priority?")&&this.$inertia.put(this.route("priorities.restore",this.priority.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(o,t,l,H,i,s){const m=n("Head"),p=n("text-input"),u=n("loading-button");return _(),b("div",null,[a(m,{title:o.$t(l.title)},null,8,["title"]),r("div",k,[r("form",{onSubmit:t[2]||(t[2]=h((...e)=>s.update&&s.update(...e),["prevent"]))},[r("div",B,[a(p,{modelValue:i.form.name,"onUpdate:modelValue":t[0]||(t[0]=e=>i.form.name=e),error:i.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",N,[r("button",{class:"text-red-600 hover:underline",tabindex:"-1",type:"button",onClick:t[1]||(t[1]=(...e)=>s.destroy&&s.destroy(...e))},d(o.$t("Delete Priority")),1),a(u,{loading:i.form.processing,class:"btn-indigo ml-auto",type:"submit"},{default:g(()=>[w(d(o.$t("Update Priority")),1)]),_:1},8,["loading"])])],32)])])}const U=V(L,[["render",C]]);export{U as default};
