diff --git a/app/components/ui/carousel.tsx b/app/components/ui/carousel.tsx deleted file mode 100644 index 6fe2f3b..0000000 --- a/app/components/ui/carousel.tsx +++ /dev/null @@ -1,171 +0,0 @@ -import { useState } from 'react' -import { Link, useLocation } from 'react-router' -import { twMerge } from 'tailwind-merge' - -import { CarouselNextIcon } from '~/components/icons/carousel-next' -import { CarouselPreviousIcon } from '~/components/icons/carousel-previous' -import { useNewsContext } from '~/contexts/news' -import type { TNews } from '~/types/news' - -import { Button } from './button' - -export const Carousel = (properties: TNews) => { - const { setIsSuccessOpen } = useNewsContext() - const [currentIndex, setCurrentIndex] = useState(0) - const { pathname } = useLocation() - const hasCategory = pathname.includes('/category/') - - const { title, description, items, type } = properties - const itemsPerPage = type === 'hero' ? 1 : 3 - const totalPages = Math.ceil(items.length / itemsPerPage) - - const nextSlide = () => { - setCurrentIndex((previousIndex) => (previousIndex + 1) % totalPages) - } - - const previousSlide = () => { - setCurrentIndex( - (previousIndex) => (previousIndex - 1 + totalPages) % totalPages, - ) - } - return ( -
- {description} -
-- {content} -
-