2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
import{q as _,b as k,r as n,e as p,f as e,t as s,M as A,F as u,i as S,g as a,w as m,k as U,L as $,c as h,l as c,n as E}from"./index.02ecb8e1.js";const I={class:"intro-y text-lg font-medium mt-10"},N={class:"grid grid-cols-12 gap-6 mt-5"},B={class:"intro-y col-span-12 flex flex-wrap sm:flex-nowrap items-center mt-2"},T=["onClick"],L={class:"intro-y col-span-12 overflow-auto lg:overflow-visible max-w-screen-lg"},R={class:"table table-report -mt-2"},q={class:"whitespace-nowrap"},D={class:"whitespace-nowrap"},V={class:"text-center whitespace-nowrap"},j={href:"",class:"font-medium whitespace-nowrap"},F={class:"text-slate-500 flex items-center mr-3",href:"javascript:;"},X={class:"w-40"},z={class:"p-5 text-center"},H=e("div",{class:"text-3xl mt-5"},"Are you sure?",-1),W=e("div",{class:"text-slate-500 mt-2"},[c(" Do you really want to delete these records? "),e("br"),c("This process cannot be undone. ")],-1),G={class:"px-5 pb-8 text-center"},J=e("button",{type:"button",class:"btn btn-danger w-24"},"Delete",-1),P={__name:"Main",setup(K){const f="https://panel.exchange.gov.tm/api",r=_(!1),i=_(!1),d=_([]),v=()=>{console.log("onAddNewUser"),U.push({path:"/create-user"})},w=async()=>{try{i.value=!0,d.value.splice(0);const t=await $.get(`${f}/account/clients`);d.value=[...t.data],i.value=!1}catch(t){console.log("error fetchUsers: ",t),i.value=!1}};return k(async()=>{await w()}),(t,l)=>{const b=n("MailIcon"),x=n("CheckSquareIcon"),y=n("XCircleIcon"),g=n("ModalBody"),M=n("Modal");return h(),p(u,null,[e("h2",I,s(t.$t("USERS")),1),e("div",N,[e("div",B,[e("button",{class:"btn btn-primary shadow-md mr-2",onClick:A(v,["prevent"])},s(t.$t("CREATE_USER")),9,T)]),e("div",L,[e("table",R,[e("thead",null,[e("tr",null,[e("th",q,s(t.$t("NAME_SURNAME")),1),e("th",D,s(t.$t("EMAIL")),1),e("th",V,s(t.$t("STATUS")),1)])]),e("tbody",null,[(h(!0),p(u,null,S(d.value,(o,C)=>(h(),p("tr",{key:C,class:"intro-x"},[e("td",null,[e("a",j,s(o.firstname)+" "+s(o.lastname),1)]),e("td",null,[e("a",F,[a(b,{class:"w-4 h-4 mr-2"}),c(" "+s(o.email),1)])]),e("td",X,[e("div",{class:E(["flex items-center justify-center",{"text-success":o.is_verified,"text-danger":!o.is_verified}])},[a(x,{class:"w-4 h-4 mr-2"}),c(" "+s(o.is_verified?"Active":"Inactive"),1)],2)])]))),128))])])])]),a(M,{show:r.value,onHidden:l[1]||(l[1]=o=>r.value=!1)},{default:m(()=>[a(g,{class:"p-0"},{default:m(()=>[e("div",z,[a(y,{class:"w-16 h-16 text-danger mx-auto mt-3"}),H,W]),e("div",G,[e("button",{type:"button",onClick:l[0]||(l[0]=o=>r.value=!1),class:"btn btn-outline-secondary w-24 mr-1"}," Cancel "),J])]),_:1})]),_:1},8,["show"])],64)}}};export{P as default};
|