import ButtonGradientPrimary from '@/components/button-gradient-primary'; import { Card } from '@/components/ui/card'; import { getPageSection } from '@/lib/page'; import { IntroPageProps } from '@/types/page'; import { router, usePage } from '@inertiajs/react'; import Section from '../section'; const TopCourse = () => { const { props } = usePage(); const { page, topCourse, customize } = props; const topCourseSection = getPageSection(page, 'top_course'); return (

{topCourseSection?.title}

{topCourse?.title}

{topCourse?.title}

{topCourse?.formatted_duration}

Course Duration

{topCourse?.total_lessons}

Course Lesson{topCourse?.total_lessons > 1 ? 's' : ''}

{topCourse?.total_quizzes}

Total Quiz{topCourse?.total_quizzes > 1 ? 'zes' : ''}

{topCourse?.enrollments_count}

Enrolled Student{(topCourse?.enrollments_count ?? 0) > 1 ? 's' : ''}

{topCourseSection?.properties?.button_text && ( router.post(route('course-cart.store'), { course_id: topCourse.id, }) } className="relative z-10 mt-10 md:mt-14" > {topCourseSection?.properties?.button_text} )}
); }; export default TopCourse;