import{t as e}from"./jsx-runtime-ByY1xr43.js";var t=e(),n=`rounded-md border border-input bg-background px-2 py-1 text-sm`,r=`inline-flex items-center gap-1 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium hover:bg-muted`;function i(){return{date:``,values:``}}function a({value:e,onChange:a,placeholder:o,testIdPrefix:s=`labs`}){function c(t,n){a(e.map((e,r)=>r===t?{...e,...n}:e))}function l(){a([...e,i()])}function u(t){a(e.filter((e,n)=>n!==t))}return(0,t.jsxs)(`div`,{className:`space-y-2`,"data-testid":s,children:[e.length===0&&(0,t.jsx)(`div`,{className:`text-xs text-muted-foreground italic`,children:`No labs added.`}),e.map((e,r)=>(0,t.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start gap-2`,"data-testid":s+`-row-`+r,children:[(0,t.jsx)(`input`,{type:`date`,value:e.date,onChange:e=>c(r,{date:e.target.value}),className:n+` w-40 shrink-0`}),(0,t.jsx)(`textarea`,{value:e.values,onChange:e=>c(r,{values:e.target.value}),placeholder:o||`e.g. WBC 12.5, H/H 10.2/31, BMP Na 138, K 3.5`,className:n+` flex-1 min-h-[60px] font-mono text-xs`}),(0,t.jsx)(`button`,{type:`button`,onClick:()=>u(r),className:`text-xs text-destructive hover:text-red-700`,title:`Remove`,children:`🗑`})]},r)),(0,t.jsx)(`button`,{type:`button`,onClick:l,className:r,children:`+ Add lab`})]})}export{i as n,a as t};