import{a as o,j as e,i as c,B as x,L as h}from"./index-7c7a558c.js";import{g}from"./productApi-2a3da157.js";const p=()=>{var t,r,d;const{data:a,isLoading:l}=o("getAllProduct",()=>g());return e.jsx("div",{className:"",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("h1",{className:"text-white text-2xl mt-10 mb-7 text-center py-2 rounded-t-md bg-[#2f2f2f]",children:"Our Product"}),l&&e.jsx("div",{className:"text-center flex justify-center items-center my-6",children:e.jsx(c,{color:"black",size:"lg",variant:"dots"})}),!l&((t=a==null?void 0:a.data)==null?void 0:t.all_products.length)>0?e.jsx("div",{className:"grid lg:grid-cols-4 md:grid-cols-3 grid-cols-2 gap-6",children:(r=a==null?void 0:a.data)==null?void 0:r.all_products.map((s,i)=>{var n;return e.jsxs("div",{className:"bg-white shadow-lg rounded-lg overflow-hidden hover:shadow-xl transition-shadow duration-300",children:[e.jsx("div",{className:"relative",children:e.jsx("img",{className:"w-full h-48 md:h-56 lg:h-64 object-cover",src:`${x}${(n=s==null?void 0:s.main_image)==null?void 0:n.substring(1)}`,alt:s.product_name})}),e.jsxs("div",{className:"p-4",children:[e.jsx("h5",{className:"text-lg font-semibold text-gray-800 mb-3 line-clamp-2 min-h-[3.5rem]",children:s.product_name}),e.jsx("div",{className:"mb-4",children:s.discount_price?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-gray-400 line-through text-sm",children:["BDT ৳",s.price]}),e.jsxs("span",{className:"text-red-500 font-bold text-lg",children:["BDT ৳",s.discount_price]})]}):e.jsxs("span",{className:"text-red-500 font-bold text-lg",children:["BDT ৳",s.price]})}),e.jsx(h,{to:`${s.id}`,className:"block w-full text-center bg-gradient-to-r from-pink-500 to-orange-500 hover:from-pink-600 hover:to-orange-600 text-white font-semibold py-3 px-4 rounded-lg transition-all duration-300 transform hover:scale-105",children:"Order Now"})]})]},i)})}):null,!l&((d=a==null?void 0:a.data)==null?void 0:d.all_products.length)==0?"Product Not Found":null]})})};export{p as default};
