import useEmblaCarousel from 'embla-carousel-react' import { useCallback } from 'react' import { Link } from 'react-router' import { twMerge } from 'tailwind-merge' import { CarouselNextIcon } from '~/components/icons/carousel-next' import { CarouselPreviousIcon } from '~/components/icons/carousel-previous' import { Button } from '~/components/ui/button' import { useNewsContext } from '~/contexts/news' import type { TNews } from '~/types/news' export const CarouselSection = (properties: TNews) => { const { setIsSuccessOpen } = useNewsContext() const { title, description, items } = properties const [emblaReference, emblaApi] = useEmblaCarousel({ loop: false }) const previousSlide = useCallback(() => { if (emblaApi) emblaApi.scrollPrev() }, [emblaApi]) const nextSlide = useCallback(() => { if (emblaApi) emblaApi.scrollNext() }, [emblaApi]) return (

{title}

{description}

{/*
{items.map( ({ featured, title, content, tags, slug, isPremium }, index) => (
{title}
{tags?.map((item) => ( {item} ))} {isPremium && ( Premium Content )}

{title}

{content}

), )}
*/}
{items.map( ({ featured, title, content, tags, slug, isPremium }, index) => (
{title}
{tags?.map((item) => ( {item} ))} {isPremium && ( Premium Content )}

{title}

{content}

), )}
//
//
//
//

// {title} //

//

// {description} //

//
//
//
// {items.map( // ({ featured, title, content, tags, slug, isPremium }, index) => ( //
// {title} //
//
// {tags?.map((item) => ( // // {item} // // ))} // {isPremium && ( // // Premium Content // // )} //
//
//

// {title} //

//

// {content} //

//
// //
//
// ), // )} //
//
//
// // //
//
//
) }