import{j as e,az as a,H as t,aA as c,aB as o,aC as d,ai as x}from"./index-CWMEhb0Z.js";function b({showInfo:l=!0,course:s}){if(!s)return null;const n=(parseInt(s.details.resourcesCount)||0)+(parseInt(s.details.articlesCount)||0)+(parseInt(s.details.assessmentsCount)||0),r=s.general.rating>=4.5||s.students_count>500;return e.jsxs("div",{className:"rounded-2xl overflow-hidden bg-neutral-100 border border-[#5B5B5B]",children:[e.jsxs("div",{className:"h-48 relative group overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 before:absolute before:w-full before:h-full before:inset-0 before:bg-gradient-to-t before:from-black/80 before:to-transparent before:content-['']"}),r&&e.jsxs(a,{className:"absolute text-md top-4 left-4 bg-white/20 backdrop-blur-sm rounded-full",children:[e.jsx(t,{icon:c,className:"!size-5"}),e.jsx("span",{className:"font-light",children:"Featured"})]}),s.is_enrolled&&e.jsx(a,{className:"absolute text-md top-4 right-4 bg-green-500/80 backdrop-blur-sm rounded-full text-white",children:e.jsx("span",{className:"font-light",children:"Enrolled"})}),e.jsx("img",{className:"w-full h-full object-cover",src:s.image_url,alt:s.title,onError:i=>{i.currentTarget.src="https://i.pinimg.com/736x/b6/2e/ac/b62eacc57b895f62002145639ad398d6.jpg"}}),l&&e.jsxs("div",{className:"absolute bottom-2 left-0 px-4 w-full text-white flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-2 sm:text-base text-xs",children:[e.jsx(t,{className:"text-main-300",icon:o}),n," lessons"]}),e.jsxs("span",{className:"flex items-center gap-2 sm:text-base text-xs",children:[e.jsx(t,{className:"text-main-300",icon:d}),s.duration]}),e.jsxs("span",{className:"flex items-center gap-2 sm:text-base text-xs",children:[e.jsx(t,{className:"text-main-300",icon:x}),s.students_count]})]})]}),e.jsxs("div",{className:"py-4 px-6 bg-[#8a2478]/5",children:[e.jsx("h4",{className:"font-semibold font-IBM-arabic text-xl mb-3 line-clamp-2",children:s.title}),e.jsx("p",{className:"text-neutral-800 flex items-center space-x-5",children:e.jsxs("span",{className:"font-bold text-main-400",children:[s.currency," ",s.price]})})]})]})}export{b as C};
