| Current Path : /home/users/unlimited/www/web.medimeet.codeskitter.site/assets/ |
| Current File : /home/users/unlimited/www/web.medimeet.codeskitter.site/assets/Prescriptions-BA8g4JNS.js |
import{r as h,d as x,j as e,O as j,E as f,B as n,T as a,a8 as g,a9 as c,P as y,Q as b,F as d,ak as _,Y as S,i as v,aV as w,aX as F,f as P,a7 as z}from"./index-CDlA-3aM.js";import{G as C}from"./index-kV9pP1gE.js";import{u as D}from"./UseDebounce-D_5sbxMP.js";import{I as E}from"./input-element-Bbt7yrud.js";import{S as B}from"./Search-DD7xJH3Y.js";import{C as I,a as W}from"./card-body-t9yk5qgp.js";function $(t){window.open(t,"_blank")}function T(){const[t,l]=h.useState(""),i=D(t,1e3),u=async()=>(await P(`get_prescription/user/${z.id}&search_query=${i}`)).data,{data:s,isLoading:m,error:p}=x({queryKey:["prescriptions",i],queryFn:u});return m?e.jsx(j,{}):p?e.jsx(f,{}):e.jsxs(n,{minH:"50vh",children:[e.jsx(n,{bg:"primary.main",p:4,py:{base:"4",md:"10"},children:e.jsx(n,{className:"container",children:e.jsx(a,{fontSize:{base:18,md:32},fontWeight:700,textAlign:"center",mt:0,color:"#fff",children:"Prescriptions"})})}),e.jsx(n,{className:"container",maxW:600,children:e.jsx(n,{w:"full",rounded:"lg",mt:5,borderRadius:8,overflow:"hidden",p:2,children:e.jsx(g,{children:e.jsxs(c.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.2},children:[e.jsx(n,{w:"100%",mx:"auto",mb:5,children:e.jsxs(y,{children:[e.jsx(E,{pointerEvents:"none",children:e.jsx(B,{color:"gray.300"})}),e.jsx(b,{placeholder:"Search Prescriptions...",value:t,onChange:r=>{let o=r.target.value;l(o)},variant:"outline",focusBorderColor:"blue.400",bg:"#fff"})]})}),s&&(s.length?e.jsx(n,{mt:5,children:s.map(r=>e.jsx(c.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.7},children:e.jsx(I,{cursor:"pointer",mb:4,onClick:()=>{},children:e.jsx(W,{p:4,children:e.jsxs(d,{align:"center",justify:"space-between",children:[e.jsxs(d,{align:"center",gap:4,children:[" ",e.jsx(C,{fontSize:24,color:"#2D3748"}),e.jsxs(n,{children:[e.jsxs(a,{fontSize:14,fontWeight:600,mb:0,children:[r.patient_f_name," ",r.patient_l_name," ","#",r.id]}),e.jsxs(a,{fontSize:13,fontWeight:500,mb:0,children:["Dr. ",r.doctor_f_name," ",r.doctor_l_name," "]}),e.jsx(a,{fontSize:12,fontWeight:600,children:_(r.created_at).format("D-MMM-YY HH:MM A")})]})]}),e.jsx(S,{icon:e.jsx(F,{}),colorScheme:"blue",size:"sm",onClick:o=>{o.stopPropagation(),$(r!=null&&r.pdf_file?`${v}/${r==null?void 0:r.pdf_file}`:`${w}/prescription/generatePDF/${r.id}`)}})]})})})},r.id))}):e.jsx(a,{fontSize:14,fontWeight:600,mb:0,textAlign:"center",children:"The files are currently unavailable. You will be able to access them once the doctor uploads the necessary documents"}))]})})})})]})}export{T as default};