PageSourceSearch

https://harbor-os.com/assets/ListingInventoryShared-CpAwrFhd.js

js harbor-os.com collected 2026-10-02 01:32:16 UTC 3,765 bytes, 1 lines download raw bytes

1import{br as o,g as x,j as e,bP as m,L as u,a1 as h,bU as g}from"./vendor-B3bqREfz.js";import{B as j,g as N}from"./index-BHZdkTHk.js";const f=l=>{const a=Number(l);return Number.isFinite(a)?a.toLocaleString(void 0,{style:"currency",currency:"USD"}):"—"};function v(){const[,l]=o("/inventory-list/:token"),a=(l==null?void 0:l.token)??"",{data:t,isLoading:c,error:n}=x({queryKey:["/api/listing-inventory/shared",a],queryFn:async()=>{const s=await fetch(`/api/listing-inventory/shared/${a}`);if(!s.ok)throw new Error((await s.json().catch(()=>({}))).message||"This link is no longer available");return s.json()},enabled:!!a,retry:!1});if(c)return e.jsx("div",{className:"max-w-5xl mx-auto p-8 text-center text-muted-foreground",children:"Loading…"});if(n||!t)return e.jsxs("div",{className:"max-w-lg mx-auto p-10 text-center",children:[e.jsx(m,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),e.jsx("h1",{className:"text-xl font-semibold mb-1",children:"Link unavailable"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:(n==null?void 0:n.message)||"This shared list link is no longer available."})]});const i=t.items.filter(s=>s.mode==="included"),r=t.items.filter(s=>s.mode==="extra"),d=({it:s})=>e.jsxs("div",{className:"border rounded-xl overflow-hidden","data-testid":`card-list-item-${s.id}`,children:[e.jsx("div",{className:"aspect-square bg-muted",children:s.imageUrl?e.jsx("img",{src:s.imageUrl,alt:s.name,className:"w-full h-full object-cover",loading:"lazy"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(g,{className:"w-8 h-8 text-muted-foreground/40"})})}),e.jsxs("div",{className:"p-2.5",children:[e.jsx("p",{className:"text-sm font-medium leading-snug line-clamp-2",children:s.name}),s.mode==="extra"?e.jsxs("p",{className:"text-sm font-semibold text-blue-700 mt-0.5",children:["+ ",f(s.extraPrice)]}):e.jsx("p",{className:"text-xs text-emerald-700 mt-0.5",children:"Included"}),s.quantity!=null&&s.quantity>1&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Qty ",s.quantity]}),s.condition&&e.jsx(N,{variant:"secondary",className:"mt-1 text-[10px]",children:s.condition})]})]});return e.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2","data-testid":"text-list-name",children:[e.jsx(m,{className:"w-6 h-6"})," ",t.folderName]}),t.listingName&&e.jsxs("p",{className:"text-muted-foreground text-sm mt-1",children:["Inventory list for ",e.jsx("span",{className:"font-medium",children:t.listingName})]}),e.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-muted-foreground",children:[e.jsxs("span",{"data-testid":"text-list-count",children:[t.totals.count," items"]}),t.totals.extras>0&&e.jsxs("span",{children:[t.totals.extras," optional extra",t.totals.extras===1?"":"s"]}),t.listingUrl&&e.jsx(u,{href:t.listingUrl,children:e.jsxs(j,{size:"sm",variant:"outline",className:"gap-1 h-7",children:[e.jsx(h,{className:"w-3.5 h-3.5"})," View listing"]})})]})]}),i.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-sm font-semibold text-emerald-700 mb-2",children:"Included in the price"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:i.map(s=>e.jsx(d,{it:s},s.id))})]}),r.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-sm font-semibold text-blue-700 mb-2",children:"Available extras"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:r.map(s=>e.jsx(d,{it:s},s.id))})]}),!t.items.length&&e.jsx("p",{className:"text-muted-foreground text-sm",children:"No items in this list yet."})]})}export{v 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.