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