module.exports=[43681,a=>{"use strict";var b=a.i(87924),c=a.i(76472),d=a.i(40784);let e=(0,a.i(70106).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var f=a.i(38246);function g({product:a}){return(0,b.jsxs)("div",{className:"   group relative bg-white border border-gray-100 overflow-hidden   transition-shadow duration-300   hover:shadow-md   ",children:[(0,b.jsx)(f.default,{href:`/product-details/${a.slug}`,className:"block",children:(0,b.jsxs)("div",{className:"relative overflow-hidden",children:[(0,b.jsx)("img",{src:a.image,alt:a.name,className:"w-full h-64 object-cover transition-transform duration-300 group-hover:scale-105"}),(0,b.jsxs)("div",{className:"absolute top-3 left-3 flex gap-2",children:[a.badge&&(0,b.jsx)("span",{className:"bg-green-500 text-white text-xs px-2 py-1",children:a.badge}),a.discount&&(0,b.jsx)("span",{className:"bg-red-500 text-white text-xs px-2 py-1",children:a.discount})]})]})}),(0,b.jsxs)("div",{className:"p-4 text-center",children:[(0,b.jsx)("p",{className:"text-xs text-gray-400 uppercase",children:"Category"}),(0,b.jsx)("h3",{className:"text-sm font-medium mt-1 text-gray-400",children:"Casual Spring Blue Shoes"}),(0,b.jsx)("div",{className:"flex justify-center text-yellow-400 text-xs mt-1",children:"★★★★★"}),(0,b.jsxs)("div",{className:"mt-2",children:[a.originalPrice!==a.salePrice&&(0,b.jsxs)("span",{className:"text-sm text-muted-foreground line-through mr-2",children:["$",a.originalPrice.toFixed(2)]}),(0,b.jsxs)("span",{className:"text-lg font-semibold text-foreground",children:["৳",a.salePrice.toFixed(2)]})]}),(0,b.jsxs)("div",{className:"mt-3 flex items-center justify-center gap-2",children:[(0,b.jsx)("button",{className:"   border border-gray-400 p-2 text-gray-400   opacity-0 group-hover:opacity-100   transition-opacity   hover:bg-gray-100   ",children:(0,b.jsx)(c.Heart,{size:16})}),(0,b.jsxs)("button",{className:"   flex items-center justify-center gap-2 px-4 py-2   border border-gray-400 text-gray-400   text-sm font-medium   transition-colors   group-hover:bg-black group-hover:text-white group-hover:border-black   ",children:[(0,b.jsx)(d.ShoppingBag,{size:16}),"cart"===a.buttonType?"Add to Cart":"Select Options"]}),(0,b.jsx)("button",{className:"   border border-gray-400 p-2 text-gray-400   opacity-0 group-hover:opacity-100   transition-opacity   hover:bg-gray-100   ",children:(0,b.jsx)(e,{size:16})})]})]})]})}a.s(["default",()=>g],43681)},24889,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(50944),e=a.i(43681);function f(){let a=(0,d.useSearchParams)(),f=a.get("search_key")||"",g=a.get("category_id")||"",[h,i]=(0,c.useState)([]),[j,k]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{if(!f)return void i([]);k(!0);let a=new URLSearchParams;a.append("search_key",f),g&&a.append("category_id",g),fetch(`https://emela.malooz.com/admin/api/v1/search?${a.toString()}`).then(a=>a.json()).then(a=>{i((a?.data?.products?.data??[]).map(a=>{let b=Number(a.base_price??0);return{id:a.id,name:a.name,slug:a.slug,category:a.categories?.[0]?.name??"",originalPrice:b,salePrice:b,rating:a.reviews?.length??0,image:a.main_image?`https://emela.malooz.com/admin/assets/images/product/${a.main_image}`:"/placeholder.png",badge:a.is_featured?"FEATURED":null,buttonType:a.has_variants?"options":"cart"}}))}).catch(()=>{i([])}).finally(()=>{k(!1)})},[f,g]),(0,b.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,b.jsxs)("h1",{className:"text-xl font-semibold mb-6",children:['Search Result for "',f,'"']}),j&&(0,b.jsx)("p",{children:"Loading..."}),!j&&0===h.length&&(0,b.jsx)("p",{children:"No product found"}),(0,b.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:h.map(a=>(0,b.jsx)(e.default,{product:a},a.id))})]})}a.s(["default",()=>f])}];

//# sourceMappingURL=src_app_06fc156e._.js.map