Your IP : 216.73.216.93


Current Path : /home/users/unlimited/www/web.medimeet.codeskitter.site/assets/
Upload File :
Current File : /home/users/unlimited/www/web.medimeet.codeskitter.site/assets/LabTests-BuUflauA.js

import{ai as v,a5 as C,ad as F,d as S,aF as _,a7 as n,j as t,O as w,E as R,B as a,T as i,G as T,e as z,i as L,ac as W,l as k,aG as A,aH as E,ah as c,av as D,f as B}from"./index-DjKxDI5z.js";/* empty css               *//* empty css                   */import{u as G}from"./CartData-BEXTpW6W.js";import{G as Q}from"./grid-item-Mhehj2ZM.js";function O(){const{cartData:f,cartLoading:g}=G(),l=v(),u=C(),m=async()=>{const e=await B("get_lab_test");return e.data.length<5?[...e.data,...e.data,...e.data]:e.data},o=F(),{isLoading:h,data:d,error:b}=S({queryKey:["Lab-tests"],queryFn:m}),j=(e,s)=>{const r=e/100*s;return parseFloat(e)+parseFloat(r)},y=async e=>{let s={user_id:n.id,product_id:null,price:e.price??"",total_price:j(e.price,e.tax)??"",mrp:e.mrp??"",tax:e.tax??"",qty:1,qty_text:"",lab_test_id:e.id};try{const r=await D(n.token,"add_cart",s);if(r.response===200)return c(o,"success","Added to cart!"),l.invalidateQueries("cartdata"),r;c(o,"error",r.message)}catch(r){return r}},x=_({mutationFn:async e=>{await y(e)},onSuccess:()=>{l.invalidateQueries("cartdata")},onError:e=>{c(o,"error",JSON.stringify(e))}}),p=e=>{if(n){let s=!1;return f.forEach(r=>{r.lab_test_id===e.id&&(s=!0)}),s}else return!1};return h||n&&g||x.isPending?t.jsx(w,{}):b?t.jsx(R,{}):t.jsxs(a,{children:[t.jsx(a,{bg:"primary.main",p:4,py:{base:"4",md:"20"},children:t.jsxs(a,{className:"container",children:[t.jsx(i,{fontFamily:"Quicksand, sans-serif",fontSize:{base:32,md:48},fontWeight:700,textAlign:"center",mt:0,color:"#fff",children:"Lab Test"}),t.jsxs(i,{fontFamily:"Quicksand, sans-serif",fontSize:{base:22,md:32},fontWeight:700,textAlign:"center",mt:0,color:"#fff",children:["Discover a Comprehensive Range of ",t.jsx("br",{}),t.jsx(i,{as:"span",color:"green.text",fontWeight:800,children:"Lab Tests"})]})]})})," ",t.jsx(a,{mt:{base:0,md:0},className:"container",pt:5,position:"relative",children:d?t.jsxs(t.Fragment,{children:[" ",t.jsxs(i,{fontSize:16,textAlign:"center",mt:2,color:"gray.500",fontWeight:500,children:["Experience precision and accuracy with our extensive selection of lab tests, ",t.jsx("br",{})," expert for designed to provide detailed insights into your health."]}),t.jsx(a,{children:t.jsx(a,{mt:4,children:t.jsx(T,{templateColumns:{base:"repeat(1, 1fr)",md:"repeat(2, 1fr)",lg:"repeat(3, 1fr)"},gap:6,children:d==null?void 0:d.map(e=>t.jsx(Q,{backgroundColor:"#FFF",borderRadius:10,cursor:"pointer",boxShadow:"2px 2px 20px 0 rgb(82 66 47 / 12%)",_hover:{border:"1px solid #0032ff"},transition:"border 0.1s ease",border:"1px solid #fff",onClick:()=>{u(`/lab-test/${e.id}`)},children:t.jsxs(a,{cursor:"pointer",gap:3,boxShadow:"0 1px 4px #00000013!important",p:4,bg:"#fff",borderRadius:8,position:"relative",children:[t.jsxs(a,{overflow:"hidden",h:"150px",w:"100%",borderRadius:5,objectFit:"cover",children:[" ",t.jsx(z,{src:e.image?`${L}/${e.image}`:"/ctscan.svg",w:"100%"})]}),t.jsxs(a,{mt:2,children:[" ",t.jsx(i,{mt:"2px",fontSize:{base:"16px",md:"28px",lg:"18px"},fontWeight:600,m:0,children:e.title}),t.jsx(i,{mt:"2px",fontSize:{base:"14px",md:"14px",lg:"14px"},fontWeight:500,m:0,children:e.sub_title}),t.jsxs(i,{mt:"2px",fontSize:{base:"16px",md:"16px",lg:"16px"},fontWeight:600,m:0,color:"primary.text",children:["Starting From ",W,e.price.toFixed(2)]}),t.jsxs(k,{fontWeight:600,size:"sm",colorScheme:"blue",mt:4,borderRadius:"30",minW:200,onClick:s=>{if(!n)return c(o,"error","Please Login First");s.stopPropagation(),x.mutate(e)},children:[p(e)?t.jsx(A,{fontSize:20,style:{marginRight:"5px"}}):t.jsx(E,{fontSize:20,style:{marginRight:"5px"}}),p(e)?"Added To Cart":"Add to Cart"]})]}),t.jsx(i,{position:"absolute",mt:"2px",fontSize:{base:"12px",md:"12px",lg:"12px"},fontWeight:500,padding:"3px 15px",background:"primary.100",borderRadius:8,right:2,top:2,children:e.offer_text})]})},e.id))})})})]}):null})]})}export{O as default};