import{I as w}from"./moment-C7JtfGJw.js";import{t as k,S as y,p as x}from"./SearchInput-BQxs0-MZ.js";import{L as v}from"./Layout-BEAmuehS.js";import{m as V}from"./mapValues-BsTqcYnb.js";import{P as B}from"./Pagination-Bj-Q2plQ.js";import{Z as L,i as I,r as n,c as i,o as d,a as o,b as e,w as c,t as a,f as N,F as S,j,e as h}from"./app-BLo7SiiE.js";import{_ as C}from"./FlashMessages-DImpr6PL.js";const H={metaInfo:{title:"Knowledge Base"},components:{Icon:w,Pagination:B,SearchInput:y,Link:I,Head:L},layout:v,props:{filters:Object,knowledge_base:Object,title:String},data(){return{form:{search:this.filters.search}}},watch:{form:{deep:!0,handler:k(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 d(),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:c(()=>[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)]),(d(!0),i(S,null,j(r.knowledge_base.data,s=>(d(),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:c(()=>[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:c(()=>[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:c(()=>[o(b,{name:"cheveron-right",class:"block w-6 h-6 fill-gray-400"})]),_:2},1032,["href"])])]))),128)),r.knowledge_base.data.length===0?(d(),i("tr",U,[e("td",Z,a(t.$t("No knowledge base found.")),1)])):N("",!0)])])]),o(g,{class:"mt-6",links:r.knowledge_base.links},null,8,["links"])])}const Y=C(H,[["render",q]]);export{Y as default};
