%PDF- %PDF-
Direktori : /home/opti/www/startup-life/assets/ |
Current File : /home/opti/www/startup-life/assets/SoldServices-fc6910d6.js |
import{e as m,u,j as r,C as g,P as a}from"./index-5492fbe1.js";import{D as x}from"./dashboard-page-layout-2cec2413.js";import{u as h}from"./useQuery-0abbcf43.js";import{h as y}from"./moment-a9aaa855.js";import{C as p}from"./index-2c4b8b3c.js";import{T as N}from"./TableComponent-59424c19.js";import"./motion-4a110d9b.js";import"./Box-263f925f.js";import"./TableRow-4b138891.js";const b=()=>h({queryFn:async()=>{var c;try{return(await m.get("/service",{params:{page:1,limit:200}})).data}catch(o){return(c=o.response)==null?void 0:c.data}},queryKey:["GET_ALL_SERVICES"]}),L=()=>{const{data:n,isLoading:i,isError:c,isPending:o}=b(),e=n==null?void 0:n.data,d=u();console.log(e);const s=["SN","Kind of service","Time Needed","Location","Rate($)","Action"],l=e==null?void 0:e.map(t=>({...t,[s[0]]:t.id,[s[1]]:t.kind,[s[2]]:y(t.availability).fromNow(),[s[3]]:t.location,[s[4]]:t.rate,[s[5]]:r.jsx("button",{className:"text-[#A8CF45] px-0 bg-transparent !border-none",onClick:()=>d(`/services/sold-services/${t.id}`),children:"View more"})}));return r.jsx(x,{children:r.jsxs("section",{className:"px-5",children:[r.jsx("header",{className:"font-semibold text-[#537473]",children:"Explore and buy services"}),r.jsx(p,{appear:i||o,children:r.jsx(g,{})}),r.jsx(p,{appear:c,children:"ERROR: INTERNET_CONNECTION_REFUSED"}),r.jsx(p,{appear:!i&&!o&&(e==null?void 0:e.length)===0,children:"No services..."}),r.jsx(p,{appear:!i&&!o&&(e==null?void 0:e.length)>0,children:r.jsx(N,{header:s,element:l})})]})})};a.string,a.string,a.string,a.string,a.string,a.number;export{L as default};