import{r as e,t}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{n,r}from"./app-CXDQ5oEH-1776590214964.js";import{t as i}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as a}from"./package-search-KozqEOTH-1776590214964.js";import{t as o}from"./search-DVz9jJxu-1776590214964.js";import{t as s}from"./button-WiAFyHfP-1776590214964.js";import{t as c}from"./UserLayout-_fUPnQhO-1776590214964.js";import{t as l}from"./ProductCard-cuRTv_LB-1776590214964.js";e();var u=t();function d({products:e,searchQuery:t}){let{t:d}=i();return(0,u.jsxs)(c,{children:[(0,u.jsx)(n,{title:t?d(`Search Results for ":query"`,{query:t}):d(`All Products`)}),(0,u.jsxs)(`div`,{className:`mb-8`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,u.jsx)(`div`,{className:`p-2 bg-primary/10 rounded-lg text-primary`,children:(0,u.jsx)(o,{className:`w-6 h-6`})}),(0,u.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:t?d(`Search Results for ":query"`,{query:t}):d(`All Products`)})]}),(0,u.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:d(`Showing :from-:to of :total matching products.`,{from:e.from||0,to:e.to||0,total:e.total})})]}),e.data.length===0?(0,u.jsxs)(`div`,{className:`text-center py-24 bg-card border border-dashed rounded-3xl text-muted-foreground shadow-sm`,children:[(0,u.jsx)(a,{className:`w-16 h-16 mx-auto opacity-20 mb-4`}),(0,u.jsx)(`h3`,{className:`font-bold text-xl mb-2 text-foreground`,children:d(`No matches found`)}),(0,u.jsx)(`p`,{className:`max-w-sm mx-auto text-sm mb-6`,children:d(`We couldn't find any products matching ":query". Try checking your spelling or using more general keywords.`,{query:t})}),(0,u.jsx)(s,{asChild:!0,variant:`outline`,className:`rounded-full shadow-sm`,children:(0,u.jsx)(r,{href:`/`,children:d(`Back to Home`)})})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4 md:gap-6`,children:e.data.map(e=>(0,u.jsx)(l,{product:e},e.id))}),e.links&&e.links.length>3&&(0,u.jsx)(`div`,{className:`flex justify-center items-center mt-12`,children:(0,u.jsx)(`div`,{className:`flex gap-1 overflow-x-auto no-scrollbar pb-2`,children:e.links.map((e,t)=>(0,u.jsx)(r,{href:e.url||`#`,className:`px-4 py-2 border rounded-lg text-sm font-bold transition-colors ${e.active?`bg-primary text-primary-foreground border-primary shadow-md`:`bg-background hover:bg-muted text-foreground`} ${!e.url&&`opacity-50 cursor-not-allowed`}`,dangerouslySetInnerHTML:{__html:e.label}},t))})})]})]})}export{d as default};