import { Card, CardContent, CardHeader } from '@/components/ui/card'; import { cn, systemCurrency } from '@/lib/utils'; import { SharedData } from '@/types/global'; import { Link, router, usePage } from '@inertiajs/react'; import { BadgeCheck, Clock, VideoIcon } from 'lucide-react'; import { Button } from '../ui/button'; interface Props { course: Course; className?: string; } const CourseCard3 = ({ course, className }: Props) => { const { props } = usePage(); const { user } = props.auth; const { translate } = props; const { frontend, common, button } = translate; const currency = systemCurrency(props.system.fields['selling_currency']); // Enrollment/Buy button component const enrollmentHandler = (course: Course) => { if (course.pricing_type === 'free') { router.post(route('enrollments.store'), { user_id: user?.id, course_id: course.id, enrollment_type: 'free', }); } else { router.post(route('course-cart.store'), { course_id: course.id, }); } }; return (
{course.title} { const target = e.target as HTMLImageElement; target.src = '/assets/images/blank-image.jpg'; }} />
{course.title}

{course.course_category.title}

{course.short_description}

{course.course_category.title}

); }; export default CourseCard3;