PageSourceSearch

https://flippix.io/assets/searched-product-card-B7NCy4bW.js

js flippix.io collected 2026-09-24 15:04:53 UTC 4,283 bytes, 1 lines download raw bytes

1import{g as z,j as e,D,J as P,S as A,a as F,d as S,L as $,n as b,o as k,p as y}from"./app-mqWwS7qW.js";import{A as C,a as U,b as I}from"./avatar-ymOESmHR.js";import{T as R,a as E}from"./toggle-group-DHemjQr7.js";import{b as L,I as B,c as M,f as O,g as V,d as G,e as Q}from"./item-DkD5EKjj.js";import{B as H}from"./badge-DPRcOU6B.js";import{a as J}from"./index-DYEf5q8V.js";import{D as _}from"./luxon-BDx6lZXm.js";import{E as q}from"./external-link-Ccw88bNm.js";import"./separator-BsVZ8JuX.js";import"./skeleton-BsiuRJaK.js";import"./image-off-CyJJScHG.js";const K=new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR",minimumFractionDigits:2,maximumFractionDigits:2}),c=s=>K.format(s);function W(s){return s.split(" ").filter(Boolean).slice(0,2).map(r=>r[0]).join("").toUpperCase()||"?"}function X(s,r){return r?`/app/products?searchQuery=${s}&marketplaceId=${r}`:`/app/products?searchQuery=${s}`}function ce({entry:s}){const r=s.products.filter(a=>a.marketplace!==null),[m,w]=z.useState(r[0]?.marketplace.id),t=s.products.find(a=>a.marketplace?.id===m)??r[0]??s.products[0],n=t?.title??s.asin,l=t?.imageUrl??null,u=t?.bestSellerRank??null,d=_.fromISO(s.lastViewedAt).setLocale("fr").toRelative(),T=X(s.asin,t?.marketplace?.id),x=W(n),p=t?.avgPrice90??null,h=t?.avgPrice30??null,i=t?.price??null,o=p??h??i,j=p!==null?90:h!==null?30:null,f=j!==null&&i!==null?`Prix moyen sur ${j} jours. Prix actuel : ${c(i)}`:void 0,g=t?.marketplace?.domain??null,v=t?.marketplace?.countryCode.toUpperCase()??"",N=g?`https://www.${g}/dp/${s.asin}`:null;return e.jsxs(L,{variant:"outline",size:"sm",children:[e.jsx(B,{variant:"image",children:l?e.jsxs(D,{children:[e.jsx(P,{asChild:!0,children:e.jsxs("button",{type:"button",className:"group relative cursor-zoom-in",children:[e.jsxs(C,{className:"size-12 rounded-sm",children:[e.jsx(U,{src:l,alt:n,className:"object-contain"}),e.jsx(I,{className:"rounded-sm text-xs",children:x})]}),e.jsx("span",{className:"absolute inset-0 flex items-center justify-center rounded-sm bg-black/40 opacity-0 transition-opacity group-hover:opacity-100",children:e.jsx(A,{className:"size-4 text-white"})})]})}),e.jsxs(F,{className:"flex max-h-[80vh] max-w-2xl items-center justify-center p-2",children:[e.jsx(S,{className:"sr-only",children:n}),e.jsx("img",{src:l,alt:n,className:"max-h-[calc(80vh-1rem)] max-w-full rounded-md object-contain"})]})]}):e.jsx(C,{className:"size-12 rounded-sm",children:e.jsx(I,{className:"rounded-sm text-xs",children:x})})}),e.jsxs(M,{className:"min-w-0",children:[e.jsx(O,{className:"block w-full min-w-0",children:e.jsx($,{href:T,className:"line-clamp-2 text-xs hover:text-primary",children:n})}),e.jsxs(V,{className:"flex items-center gap-1.5 text-xxs",children:[e.jsx(H,{variant:"secondary",className:"h-4 px-1.5 py-0 font-mono text-xxs",children:s.asin}),d&&e.jsx("span",{children:d})]})]}),e.jsxs(G,{children:[e.jsxs("div",{className:"flex flex-col items-end gap-0.5",children:[o!==null&&(f?e.jsxs(b,{children:[e.jsx(k,{asChild:!0,children:e.jsx("span",{tabIndex:0,className:"text-xs font-medium tabular-nums",children:c(o)})}),e.jsx(y,{side:"top",children:f})]}):e.jsx("span",{className:"text-xs font-medium tabular-nums",children:c(o)})),u!==null&&e.jsxs("span",{className:"text-xxs tabular-nums text-muted-foreground",children:["#",u.toLocaleString("fr-FR")]})]}),N&&e.jsxs(b,{children:[e.jsx(k,{asChild:!0,children:e.jsx("a",{href:N,target:"_blank",rel:"noopener noreferrer","aria-label":`Ouvrir ce produit sur Amazon ${v}`,className:"flex cursor-pointer items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary",children:e.jsx(q,{className:"size-3.5 shrink-0"})})}),e.jsxs(y,{side:"top",className:"text-xs",children:["Ouvrir sur Amazon ",v]})]})]}),r.length>1&&e.jsx(Q,{children:e.jsx("div",{className:"ml-auto",children:e.jsx(R,{type:"single",variant:"outline",size:"sm",value:m,onValueChange:a=>{a&&w(a)},children:r.map(a=>e.jsx(E,{value:a.marketplace.id,"aria-label":`Voir sur ${a.marketplace.countryCode.toUpperCase()}`,className:"h-6 cursor-pointer px-1.5",children:e.jsx(J,{countryCode:a.marketplace.countryCode,className:"h-3 w-4 roun
1ded-sm"})},a.marketplace.id))})})})]})}export{ce as SearchedProductCard};

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.