PageSourceSearch

https://nexbid.dev/assets/ProductDetailPage-dIb9ZZg7.js

js nexbid.dev collected 2026-09-24 13:31:29 UTC 5,180 bytes, 1 lines download raw bytes

1import{a as N,u as v,r as o,j as e,L as d,S as k,p as w}from"./index-CiU28txl.js";import{B as P}from"./BreadcrumbJsonLd-D0bBP40X.js";function $(s,a){return`${(s/100).toFixed(2)} ${a}`}function L({availability:s}){const a={in_stock:{label:"In Stock",className:"bg-green-50 text-green-700 ring-green-600/20"},preorder:{label:"Pre-order",className:"bg-yellow-50 text-yellow-700 ring-yellow-600/20"},out_of_stock:{label:"Out of Stock",className:"bg-red-50 text-red-700 ring-red-600/20"}}[s]??{label:s,className:"bg-surface-bg text-text-secondary"};return e.jsx("span",{className:`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium ring-1 ring-inset ${a.className}`,children:a.label})}function E(){const{id:s}=N(),{locale:a}=v(),[n,g]=o.useState(null),[h,x]=o.useState(!0),[m,b]=o.useState(null);if(o.useEffect(()=>{if(!s)return;let l=!0;return(async()=>{try{const r=await fetch(`/api/products?id=${s}`);if(!r.ok)throw new Error(r.status===404?"Product not found":`HTTP ${r.status}`);const y=await r.json();l&&(g(y),x(!1))}catch(r){l&&(b(r instanceof Error?r.message:"Unknown error"),x(!1))}})(),()=>{l=!1}},[s]),o.useEffect(()=>(n?.product&&(document.title=`${n.product.title} | Nexbid`),()=>{document.title="Nexbid"}),[n?.product]),h)return e.jsx("div",{className:"mx-auto max-w-4xl px-4 py-12",children:e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"mb-4 h-8 w-2/3 rounded bg-surface-sunken"}),e.jsx("div",{className:"mb-2 h-4 w-1/3 rounded bg-surface-sunken"}),e.jsx("div",{className:"mb-8 h-64 w-full rounded bg-surface-sunken"})]})});if(m||!n)return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12 text-center",children:[e.jsx("h1",{className:"mb-4 text-2xl font-bold text-text-primary",children:"Product Not Found"}),e.jsx("p",{className:"mb-6 text-text-muted",children:m??"The product could not be loaded."}),e.jsx(d,{to:"/products",className:"inline-block rounded-lg bg-sky-600 px-6 py-2 text-sm font-medium text-white hover:bg-sky-700",children:"Back to Products"})]});const{product:t}=n,c=a==="en",i=c?"/products":"/produkte",u=c?"Products":"Produkte",f=encodeURIComponent(t.title.toLowerCase().replace(/\s+/g,"-")),p=`/p/${t.id}/${f}`,j=[{name:c?"Home":"Startseite",item:"https://nexbid.dev/"},{name:u,item:`https://nexbid.dev${i}`},...t.category?[{name:t.category,item:`https://nexbid.dev${i}?category=${encodeURIComponent(t.category)}`}]:[],{name:t.title,item:`https://nexbid.dev${p}`}];return e.jsxs(e.Fragment,{children:[e.jsx(k,{title:t.title,description:t.description?t.description.slice(0,160):c?`${t.title} — View details and pricing on Nexbid.`:`${t.title} — Details und Preise auf Nexbid.`,path:p,type:"product",image:t.imageUrl??void 0,structuredData:n.schemaOrg}),e.jsx(P,{items:j}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12",children:[e.jsxs("nav",{className:"mb-6 text-sm text-text-muted","aria-label":"Breadcrumb",children:[e.jsx(d,{to:i,className:"hover:text-sky-600",children:u}),t.category&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2",children:"/"}),e.jsx(d,{to:`${i}?category=${encodeURIComponent(t.category)}&q=product`,className:"hover:text-sky-600",children:t.category})]}),e.jsx("span",{className:"mx-2",children:"/"}),e.jsx("span",{className:"text-text-primary",children:t.title})]}),e.jsxs("div",{className:"grid gap-8 md:grid-cols-2",children:[e.jsx("div",{className:"flex items-center justify-center rounded-lg bg-surface-bg p-8",children:t.imageUrl?e.jsx("img",{src:t.imageUrl,alt:t.title,className:"max-h-80 w-full object-contain"}):e.jsx("div",{className:"flex h-64 w-full items-center justify-center text-text-muted",children:e.jsx("svg",{className:"h-24 w-24",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})})}),e.jsxs("div",{children:[e.jsx("h1",{className:"mb-2 text-2xl font-bold text-text-primary",children:t.title}),t.brand&&e.jsx("p",{className:"mb-3 text-sm text-text-muted",children:t.brand}),e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("span",{className:"text-3xl font-bold text-sky-600",children:$(t.price.amount,t.price.currency)}),e.jsx(L,{availability:t.availability})]}),t.description&&e.jsx("p",{className:"mb-6 text-sm leading-relaxed text-text-secondary",children:t.description}),e.jsx("a",{...w(t.url,{productId:t.id,eventProps:{surface:"product_detail"}}),target:"_blank",rel:"noopener noreferrer",className:"inline-block rounded-lg bg-sky-600 px-8 py-3 text-sm font-semibold text-white transition-colors hover:bg-sky-700",children:"View Product"}),e.jsxs("div",{className:"mt-8 space-y-2 border-t border-border-subtle pt-6 text-xs text-text-muted",children:[t.category&&e.jsxs("p",{children:["Category: ",t.category]}),t.geoScope&&e.jsxs("p",{children:["Available in: ",t.geoScope.join(", ")
1]}),e.jsxs("p",{children:["Product ID: ",t.id]}),e.jsxs("p",{children:["Last updated: ",new Date(t.updatedAt).toLocaleDateString()]})]})]})]})]})]})}export{E as Component};

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.