import{_ as F}from"./question-c35b46bb.js";import{a as I,A as T,k as c,L as $,x as U,C as V,r as n,o as s,q as m,d as a,e as j,f as d,c as p,F as D,n as G,w as o,v as R,j as z,t as b}from"./index-0c00d6f8.js";const M={class:"h-full flex flex-col"},H={class:"bg-white rounded-3xl h-full shadow-[0_7px_6px_0px,rgba(#B1B1B11A)] flex-1 flex flex-col"},J={key:0,class:"h-full flex flex-col items-center justify-center space-y-6"},K={class:"text-center"},O={class:"mt-4 font-semibold text-text text-center"},P={key:1,class:"mt-4 font-semibold text-text text-center"},Q={class:"flex items-center gap-1"},ee={__name:"index",setup(W){const{t}=I(),i=T(),_=c(null),k=[{path:"/",imgIcon:"menu-setup.svg",name:t("TITLES.home")},{path:"/contact-us",imgIcon:"",name:t("LABELS.contactUs")}],u=c(!0),f=c([]);c(!1),$({id:0,content:""});const B=[{text:t("LABELS.content"),align:"start",sortable:!1,value:"type"},{text:t("LABELS.full_name"),align:"start",sortable:!1,value:"full_name"},{text:t("LABELS.email"),align:"start",sortable:!1,value:"email"},{text:t("LABELS.phone"),align:"start",sortable:!1,value:"phone"},{text:t("LABELS.country"),align:"start",sortable:!1,value:"country"},{text:t("LABELS.city"),align:"start",sortable:!1,value:"city"},{text:t("LABELS.postalCode"),align:"start",sortable:!1,value:"postal_code"}],v=c(null);function y(){_.value=null,u.value=!0,z.get("contacts",{params:{keyword:i.query.keyword||"",page:+i.query.page||1}}).then(l=>{f.value=l.data.data,v.value=l.data.meta,u.value=!1}).catch(l=>{u.value=!1,_.value=l.response})}U(()=>{i.query.keyword&&(h.value=!0),y()});const h=c(!1);return V(()=>i.query,()=>{i.query.keyword&&(h.value=!0),y()}),(l,x)=>{var g,L;const E=n("breadcrumbs"),S=n("Loader"),A=n("NotFound"),w=n("GlobalError"),q=n("loader"),r=n("small-details-card"),N=n("data-table"),C=n("base-pagination");return s(),m("div",M,[a(E,{items:k,title:j(t)("LABELS.contactUs"),back:"/",class:"mb-2"},null,8,["title"]),d("div",H,[u.value?(s(),p(S,{key:0})):(s(),m(D,{key:1},[((g=_.value)==null?void 0:g.status)===404?(s(),p(A,{key:0})):((L=_.value)==null?void 0:L.status)===500?(s(),p(w,{key:1})):(s(),m("div",{key:2,class:G(f.value.length?"":"h-full")},[a(N,{headers:B,items:f.value,loading:u.value,"hide-footer":""},{loading:o(()=>[a(q,{class:"py-7"})]),"empty-message":o(()=>[l.$route.query.keyword?(s(),m("h3",P,b(l.$t("TITLES.No Search result")),1)):(s(),m("div",J,[d("div",K,[x[0]||(x[0]=d("img",{class:"mx-auto",src:F,alt:""},null,-1)),d("h3",O,b(l.$t("TITLES.No have been Found",{name:l.$t("LABELS.contactUs")})),1)])]))]),"item-city":o(({city:e})=>[a(r,{title:e},null,8,["title"])]),"item-postal_code":o(({postal_code:e})=>[a(r,{title:e},null,8,["title"])]),"item-country":o(({country:e})=>[a(r,{title:e},null,8,["title"])]),"item-phone":o(({phone:e})=>[a(r,{title:e},null,8,["title"])]),"item-full_name":o(({name:e})=>[a(r,{title:e},null,8,["title"])]),"item-type":o(({type:e,id:X})=>[d("div",Q,[a(r,{title:e},null,8,["title"])])]),"item-email":o(({email:e})=>[a(r,{title:e??null},null,8,["title"])]),_:1},8,["items","loading"])],2))],64))]),v.value?(s(),p(C,{key:0,item:v.value},null,8,["item"])):R("",!0)])}}};export{ee as default};
