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