import{j as v,q as b,f as n,i as c,b as t,e as u,F as h,t as k,G as w,J as y,v as a,T as g,s as p,c as C,a as $,r as d,_ as R}from"./index-DLUb5LSe.js";import{u as M}from"./data-D7xXWmPy.js";import{_ as V}from"./TopBar.vue_vue_type_script_setup_true_lang-DNeo4_WD.js";import{_ as B}from"./BottomNav.vue_vue_type_script_setup_true_lang-BcRvF8NM.js";const F={class:"pb-32 min-h-dvh"},N={class:"max-w-md mx-auto px-4 pt-2"},j={key:0,class:"text-center py-12 text-ink-muted"},D=["onClick"],S={class:"flex items-start gap-3"},I={class:"w-10 h-10 rounded-card bg-brand-50 text-2xl flex items-center justify-center"},P={class:"flex-1 min-w-0"},T={class:"font-bold text-body truncate"},q={class:"text-meta text-ink-muted"},z={class:"text-meta text-brand-600 font-semibold mt-0.5"},E={class:"text-meta text-ink-muted mt-1.5 line-clamp-2"},G={class:"w-full bg-surface rounded-t-card max-h-[90dvh] overflow-y-auto safe-bottom"},J={class:"p-6 max-w-md mx-auto"},L={class:"text-display"},U={class:"text-meta text-ink-muted mt-1"},A={class:"mt-4"},H={class:"text-body whitespace-pre-wrap"},K={class:"mt-5 flex gap-2"},O=["href"],Q=v({__name:"ReportsView",setup(W){const l=M(),o=p(null),r=p(!1);b(()=>l.loadMedicalReports());const m=C(()=>l.medicalReports??[]);async function _(i){r.value=!0,o.value=await l.loadMedicalReport(i),r.value=!1}function f(i){return`${$}/medical-reports/${i}/print`}const x=i=>({dog:"🐕",cat:"🐈",rabbit:"🐇",bird:"🦜",fish:"🐟"})[i]??"🐾";return(i,e)=>(d(),n("div",F,[c(V),t("main",N,[e[3]||(e[3]=t("h1",{class:"text-display py-4"},"Medical reports",-1)),m.value.length===0?(d(),n("div",j,[...e[2]||(e[2]=[t("div",{class:"text-5xl mb-3 opacity-60"},"📄",-1),t("p",{class:"text-meta"},"No medical reports yet.",-1)])])):u("",!0),(d(!0),n(h,null,k(m.value,s=>(d(),n("article",{key:s.id,class:"rounded-card bg-surface shadow-card p-4 mb-3 active:scale-[0.99] cursor-pointer",onClick:X=>_(s.id)},[t("div",S,[t("div",I,a(x(s.pet_species)),1),t("div",P,[t("div",T,a(s.title),1),t("div",q,a(s.pet_name)+" · "+a(s.doctor_name??"—"),1),t("div",z,a(s.date_label),1),t("p",E,a(s.preview),1)])])],8,D))),128))]),c(g,{name:"sheet"},{default:w(()=>[o.value?(d(),n("div",{key:0,class:"fixed inset-0 z-50 bg-black/40 flex items-end",onClick:e[1]||(e[1]=y(s=>o.value=null,["self"]))},[t("div",G,[t("div",J,[t("div",L,a(o.value.title),1),t("div",U,a(o.value.date_label)+" · "+a(o.value.doctor_name??"—"),1),t("div",A,[e[4]||(e[4]=t("div",{class:"text-micro uppercase text-ink-subtle tracking-wider mb-1"},"Findings",-1)),t("p",H,a(o.value.findings||"—"),1)]),t("div",K,[t("a",{href:f(o.value.id),target:"_blank",class:"flex-1 h-12 rounded-card bg-brand-500 text-white font-bold inline-flex items-center justify-center"},"🖨️ Print / Save PDF",8,O),t("button",{class:"px-4 h-12 rounded-card bg-surface-muted text-ink font-semibold",onClick:e[0]||(e[0]=s=>o.value=null)},"Close")])])])])):u("",!0)]),_:1}),c(B)]))}}),st=R(Q,[["__scopeId","data-v-986e8190"]]);export{st as default};
//# sourceMappingURL=ReportsView-GgLwnw4l.js.map
