ldc-ovoteam/resources/ts/front/Components/Base/Carousel/Carousel.tsx

19 lines
566 B
TypeScript
Raw Permalink Normal View History

import useInView from "@/hooks/use-in-view";
2026-03-30 13:52:00 +02:00
import CarouselContent from "./CarouselContent";
import { CarouselPropsWithNavigation } from "@/types/front";
type Props = CarouselPropsWithNavigation & {
className?: string;
2026-04-08 13:59:30 +02:00
};
export default function Carousel(props: Props) {
2026-03-30 13:52:00 +02:00
const { className, ...carouselProps } = props;
const { ref, isVisible } = useInView();
return (
<div ref={ref} className={className}>
2026-04-08 13:59:30 +02:00
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
2026-03-30 13:52:00 +02:00
{isVisible && <CarouselContent {...carouselProps} />}
</div>
2026-04-08 13:59:30 +02:00
);
2026-03-30 13:52:00 +02:00
}