import { useState } from 'react'; import { Dimensions, View } from 'react-native'; import { LinearGradient } from 'expo-linear-gradient'; import { Carousel, CarouselContent, CarouselItem } from '../ui/carousel'; import { Media } from '../ui/media'; import { useResource } from '@/hooks/use-resource'; const { width: screenWidth } = Dimensions.get('window'); interface MediaCarouselProps { sources: any[]; width?: number; height?: number; autoPlay?: boolean; loop?: boolean; } export function MediaCarousel({ sources, width = screenWidth, height = 410, autoPlay = false, loop = true, }: MediaCarouselProps) { const [current, setCurrent] = useState(0); return ( {sources.map((_source, index) => { const { source, poster } = useResource(_source, { width: screenWidth }) return ( ) })} {sources.map((_, index) => ( ))} ); }