import{I as w}from"./moment-DeOISj6Y.js";import{t as x,S as y,p as k}from"./SearchInput-BhrnFjZw.js";import{L as v}from"./Layout-BNWXhjq5.js";import{m as V}from"./mapValues-DT3qyRA0.js";import{P as N}from"./Pagination-KBt07-7T.js";import{Z as I,i as L,r as n,c as l,o as c,a as o,b as t,w as d,t as a,f as S,F as q,j,e as h}from"./app-BhD6J0Va.js";import{_ as B}from"./FlashMessages-DW2Y2mP0.js";const C={metaInfo:{title:"FAQs"},components:{Icon:w,Pagination:N,SearchInput:y,Link:L,Head:I},layout:v,props:{filters:Object,faqs:Object,title:String},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:x(function(){this.$inertia.get(this.route("faqs"),k(this.form),{preserveState:!0})},150)}},methods:{reset(){this.form=V(this.form,()=>null)}}},F={class:"mb-6 flex justify-between items-center"},H={class:"bg-white rounded-md shadow overflow-x-auto"},$={class:"w-full whitespace-nowrap"},A={class:"text-left font-bold"},O={class:"px-6 pt-6 pb-4"},P={class:"px-6 pt-6 pb-4"},R={class:"border-t"},D={class:"border-t"},E={class:"border-t w-px"},Q={key:0},T={class:"border-t px-6 py-4",colspan:"4"};function U(e,f,r,Z,m,u){const p=n("Head"),_=n("search-input"),i=n("Link"),b=n("icon"),g=n("pagination");return c(),l("div",null,[o(p,{title:e.$t(r.title)},null,8,["title"]),t("div",F,[o(_,{modelValue:m.form.search,"onUpdate:modelValue":f[0]||(f[0]=s=>m.form.search=s),class:"w-full max-w-md mr-4",onReset:u.reset},null,8,["modelValue","onReset"]),o(i,{class:"btn-indigo",href:e.route("faqs.create")},{default:d(()=>[t("span",null,a(e.$t("Create New")),1)]),_:1},8,["href"])]),t("div",H,[t("table",$,[t("tbody",null,[t("tr",A,[t("th",O,a(e.$t("Name")),1),t("th",P,a(e.$t("Status")),1)]),(c(!0),l(q,null,j(r.faqs.data,s=>(c(),l("tr",{key:s.id,class:"hover:bg-gray-100 focus-within:bg-gray-100"},[t("td",R,[o(i,{class:"px-6 py-4 flex items-center focus:text-indigo-500",href:e.route("faqs.edit",s.id)},{default:d(()=>[h(a(s.name),1)]),_:2},1032,["href"])]),t("td",D,[o(i,{class:"px-6 py-4 flex items-center",href:e.route("faqs.edit",s.id),tabindex:"-1"},{default:d(()=>[h(a(s.status?"Active":"Inactive"),1)]),_:2},1032,["href"])]),t("td",E,[o(i,{class:"px-4 flex items-center",href:e.route("faqs.edit",s.id),tabindex:"-1"},{default:d(()=>[o(b,{name:"cheveron-right",class:"block w-6 h-6 fill-gray-400"})]),_:1},8,["href"])])]))),128)),r.faqs.data.length===0?(c(),l("tr",Q,[t("td",T,a(e.$t("No faqs found.")),1)])):S("",!0)])])]),o(g,{class:"mt-6",links:r.faqs.links},null,8,["links"])])}const Y=B(C,[["render",U]]);export{Y as default};
