import{aT as f,j as e,aS as h,aX as i,b4 as n,cD as g,eH as j}from"./react-vendor-xYZnmIII.js";import{a6 as N,a as w,c as y,k as C,l as _,B as l}from"./ui-components-CQM92IK3.js";import{C as v}from"./checkout-item-COhV8mha.js";const E=({course:s,className:o})=>{const{props:t}=f(),{user:a}=t.auth,{translate:c}=t,{frontend:d,common:m,button:r}=c,{amount:x}=N(t.system.fields.selling_currency);return e.jsxs(w,{className:y(o),children:[e.jsx(C,{className:"p-0",children:e.jsx("div",{className:"relative",children:e.jsx("div",{className:"p-2 pb-0",children:e.jsx(h,{href:route("course.details",{slug:s.slug,id:s.id}),children:e.jsxs("div",{className:"group relative h-[320px] w-full overflow-hidden rounded-lg",children:[e.jsx("img",{src:s.thumbnail||"/assets/images/blank-image.jpg",alt:s.title,className:"h-full w-full object-cover transition-transform duration-300 group-hover:scale-105",onError:p=>{const u=p.target;u.src="/assets/images/blank-image.jpg"}}),e.jsxs("div",{className:"from-primary dark:from-primary-foreground absolute bottom-0 left-1/2 flex h-full w-full -translate-x-1/2 flex-col justify-end bg-gradient-to-t p-4 text-center text-white opacity-0 transition-all duration-200 group-hover:opacity-100",children:[e.jsx("h6",{className:"text-2xl font-semibold md:text-3xl",children:s.title}),e.jsx("p",{className:"mt-1 md:text-lg",children:s.course_category.title})]})]})})})})}),e.jsxs(_,{className:"space-y-4 p-5",children:[e.jsx("p",{children:s.short_description}),e.jsxs("div",{className:"flex flex-col items-center gap-3 sm:flex-row",children:[s.pricing_type==="free"?e.jsxs(l,{className:"w-full px-5 sm:w-auto",onClick:()=>i.post(route("enrollments.store"),{user_id:a==null?void 0:a.id,course_id:s.id,enrollment_type:"free"}),children:[e.jsx(n,{})," ",m.free," | ",r.enroll_now]}):e.jsx(v,{item:"course",item_id:s.id,className:"w-full sm:w-auto",children:e.jsxs(l,{className:"w-full px-5 sm:w-auto",children:[e.jsx(n,{})," ",x(s.price)," | ",r.enroll_now]})}),e.jsxs(l,{variant:"outline",className:"w-full px-5 sm:w-auto",onClick:()=>i.get(route("course.details",{slug:s.slug,id:s.id})),children:[e.jsx(g,{})," ",d.course_details]})]}),e.jsxs("p",{className:"flex items-center gap-2",children:[e.jsx(j,{size:16}),e.jsx("span",{className:"text-sm",children:s.course_category.title})]})]})]})};export{E as C};
