import{L as h}from"./Layout-BEAmuehS.js";import{T as _}from"./TextInput-D6G3wYlu.js";import{S as w}from"./SelectInput-Bl1ROfev.js";import{T as y}from"./TextareaInput-DxBbHHRp.js";import{L as g}from"./LoadingButton-fIGCYE5-.js";import{Z as q,i as v,r as a,c as V,o as x,a as i,b as s,d as S,w as m,t as n,e as k}from"./app-BLo7SiiE.js";import{_ as I}from"./FlashMessages-DImpr6PL.js";import"./moment-C7JtfGJw.js";import"./v4-SoommWqA.js";const L={metaInfo(){return{title:this.form.name}},components:{LoadingButton:g,SelectInput:w,TextareaInput:y,TextInput:_,Link:v,Head:q},layout:h,props:{faq:Object,title:String},remember:"form",data(){return{form:this.$inertia.form({name:this.faq.name,status:this.faq.status,details:this.faq.details})}},methods:{update(){this.form.put(this.route("faqs.update",this.faq.id))},destroy(){confirm("Are you sure you want to delete this faq?")&&this.$inertia.delete(this.route("faqs.destroy",this.faq.id))},restore(){confirm("Are you sure you want to restore this faq?")&&this.$inertia.put(this.route("faqs.restore",this.faq.id))}}},T={class:"bg-white rounded-md shadow overflow-hidden max-w-full"},B={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},D={value:1},N={value:0},U={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex items-center"};function A(r,e,u,C,t,l){const d=a("Head"),p=a("text-input"),f=a("select-input"),c=a("textarea-input"),b=a("loading-button");return x(),V("div",null,[i(d,{title:u.title},null,8,["title"]),s("div",T,[s("form",{onSubmit:e[4]||(e[4]=S((...o)=>l.update&&l.update(...o),["prevent"]))},[s("div",B,[i(p,{modelValue:t.form.name,"onUpdate:modelValue":e[0]||(e[0]=o=>t.form.name=o),error:t.form.errors.name,class:"pr-6 pb-8 w-full lg:w-1/2",label:r.$t("Name")},null,8,["modelValue","error","label"]),i(f,{modelValue:t.form.status,"onUpdate:modelValue":e[1]||(e[1]=o=>t.form.status=o),error:t.form.errors.status,class:"pr-6 pb-8 w-full lg:w-1/2",label:r.$t("Status")},{default:m(()=>[s("option",D,n(r.$t("Active")),1),s("option",N,n(r.$t("Inactive")),1)]),_:1},8,["modelValue","error","label"]),i(c,{id:"ticketDetails",name:"content",modelValue:t.form.details,"onUpdate:modelValue":e[2]||(e[2]=o=>t.form.details=o),error:t.form.errors.details,class:"pr-6 pb-8 w-full",rows:5,placeholder:r.$t("Description")},null,8,["modelValue","error","placeholder"])]),s("div",U,[s("button",{class:"text-red-600 hover:underline",tabindex:"-1",type:"button",onClick:e[3]||(e[3]=(...o)=>l.destroy&&l.destroy(...o))},n(r.$t("Delete")),1),i(b,{loading:t.form.processing,class:"btn-indigo ml-auto",type:"submit"},{default:m(()=>[k(n(r.$t("Update")),1)]),_:1},8,["loading"])])],32)])])}const J=I(L,[["render",A]]);export{J as default};
