1import{r as o,h as f,j as e,c as j}from"./index-Ci53hMpI.js";import{P as g}from"./ProductCard-D3Z48A55.js";function y({limit:u=50,query:x,title:d,eyebrow:a,filter:c,sort:l,onLoaded:m}){const[s,h]=o.useState(null),[n,p]=o.useState(null);return o.useEffect(()=>{let t=!0;return f(u,x).then(i=>{if(!t)return;let r=c?i.filter(c):i;l&&(r=r.slice().sort(l)),h(r),m?.(r.length)}).catch(i=>{t&&p("Could not load products. Please try again.")}),()=>{t=!1}},[u,x,c,l,m]),e.jsxs("section",{className:"container-rail",children:[(d||a)&&e.jsx("div",{className:"mb-12 flex items-end justify-between gap-6 flex-wrap",children:e.jsxs("div",{children:[a&&e.jsx("div",{className:"eyebrow text-muted-foreground mb-3",children:a}),d&&e.jsx("h2",{className:"display-lg",children:d})]})}),n&&e.jsx("div",{className:"py-20 text-center text-sm text-destructive",children:n}),s===null&&!n&&e.jsx("div",{className:"py-20 flex justify-center",children:e.jsx(j,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),s&&s.length===0&&e.jsxs("div",{className:"py-32 text-center border border-dashed border-border",children:[e.jsx("p",{className:"font-display text-2xl mb-2",children:"No products found"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tell the chat what you'd like to add and the price."})]}),s&&s.length>0&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-6 gap-y-14",children:s.map(t=>e.jsx(g,{product:t},t.node.id))})]})}export{y as P};
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.