"use client"; import useEmblaCarousel from "embla-carousel-react"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { useCallback } from "react"; import { DotCta } from "@/components/atoms/DotCta"; import { ProgramCard } from "@/components/molecules/Cards"; import { Button } from "@/components/ui/button"; import type { Program } from "@/lib/types"; export function ProgramCarousel({ title, programs, keepExploringLabel, hideTitle = false, }: { title: string; programs: Program[]; keepExploringLabel: string; hideTitle?: boolean; }) { const [emblaRef, emblaApi] = useEmblaCarousel({ align: "start", direction: "rtl", loop: false, containScroll: "trimSnaps", }); const scrollPrev = useCallback(() => emblaApi?.scrollPrev(), [emblaApi]); const scrollNext = useCallback(() => emblaApi?.scrollNext(), [emblaApi]); return (
{!hideTitle && title ? (

{title}

) : ( )}
{programs.map((program) => (
))}
{keepExploringLabel}
); }