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