1import{r as g,j as e}from"./react-vendor-DuanA9jM.js";import{F as y,T as b,a as w,b as n,P as o,B as l,S as m,c as d,L as c,C as x,d as u,e as p,f as h}from"./index-C5q0TaF9.js";import{u as v,a as T}from"./useMyClinicalOrders-BMphVAFU.js";import{D as f}from"./DownloadOrderPdfButton-BPWjDzxm.js";import{f as j}from"./date-vendor-IjrnU_nu.js";import"./pdf-vendor-Bjqeze7v.js";import"./ui-vendor-Bb6GvRc1.js";import"./chart-vendor-CP7R5S7C.js";import"./form-vendor-DsvdbqT8.js";import"./motion-vendor-B1Dv_HZR.js";function N(s){const i={issued:"bg-blue-500/15 text-blue-600 border-blue-500/30",acknowledged:"bg-emerald-500/15 text-emerald-600 border-emerald-500/30",cancelled:"bg-muted text-muted-foreground border-border"};return e.jsx(l,{variant:"outline",className:i[s]??"",children:s})}function P({rx:s}){return e.jsxs(x,{children:[e.jsxs(u,{className:"pb-2 flex flex-row items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(p,{className:"text-base flex items-center gap-2",children:[e.jsx(o,{className:"h-4 w-4 text-primary"}),s.medicationName]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:[s.dosage,s.frequency,s.route].filter(
1Boolean).join(" · ")||"No dosing info"})]}),N(s.status)]}),e.jsxs(h,{className:"text-sm space-y-2",children:[s.duration&&e.jsxs("p",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Duration:"})," ",s.duration]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Refills:"})," ",s.refills]}),s.instructions&&e.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:s.instructions}),s.issuedAt&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Issued ",j(new Date(s.issuedAt),"PP")]}),e.jsx("div",{className:"pt-1",children:e.jsx(f,{orderType:"prescription",orderId:s.id,variant:"outline",label:"Download PDF"})})]})]})}function C({r:s}){return e.jsxs(x,{children:[e.jsxs(u,{className:"pb-2 flex flex-row items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(p,{className:"text-base flex items-center gap-2",children:[e.jsx(m,{className:"h-4 w-4 text-primary"}),s.referredToName]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:[s.referredToSpecialty,s.referredToContact].filter(Boolean).join(" · ")||"Specialist referral"})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[N(s.status),e.jsx(l,{variant:"outline",className:"text-[10px] uppercase",children:s.urgency})]})]}),e.jsxs(h,{className:"text-sm space-y-2",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Reason:"})," ",s.reason]}),s.clinicalSummary&&e.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:s.clinicalSummary}),s.issuedAt&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Issued ",j(new Date(s.issuedAt),"PP")]}),e.jsx("div",{className:"pt-1",children:e.jsx(f,{orderType:"referral",orderId:s.id,variant:"outline",label:"Download PDF"})})]})]})}function E(){const[s,i]=g.useState("prescriptions"),t=v(),r=T();return e.jsxs("div",{className:"max-w-4xl mx-auto p-4 md:p-6 space-y-4",children:[e.jsxs("header",{className:"flex items-center gap-3",children:[e.jsx(y,{className:"h-6 w-6 text-primary"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-semibold",children:"My Orders"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Prescriptions and referrals issued by your care team."})]})]}),e.jsxs(b,{value:s,onValueChange:a=>i(a),children:[e.jsxs(w,{children:[e.jsxs(n,{value:"prescriptions",className:"gap-2",children:[e.jsx(o,{className:"h-4 w-4"})," Prescriptions",t.data&&e.jsx(l,{variant:"secondary",className:"ml-1",children:t.data.length})]}),e.jsxs(n,{value:"referrals",className:"gap-2",children:[e.jsx(m,{className:"h-4 w-4"})," Referrals",r.data&&e.jsx(l,{variant:"secondary",className:"ml-1",children:r.data.length})]})]}),e.jsxs(d,{value:"prescriptions",className:"space-y-3 mt-4",children:[t.isLoading&&e.jsx(c,{className:"h-5 w-5 animate-spin text-muted-foreground"}),t.data?.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No prescriptions have been issued to you yet."}),t.data?.map(a=>e.jsx(P,{rx:a},a.id))]}),e.jsxs(d,{value:"referrals",className:"space-y-3 mt-4",children:[r.isLoading&&e.jsx(c,{className:"h-5 w-5 animate-spin text-muted-foreground"}),r.data?.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No referrals have been issued to you yet."}),r.data?.map(a=>e.jsx(C,{r:a},a.id))]})]})]})}export{E as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.