()
| 30 | const CarouselContext = React.createContext<CarouselContextProps | null>(null); |
| 31 | |
| 32 | function useCarousel() { |
| 33 | const context = React.useContext(CarouselContext); |
| 34 | |
| 35 | if (!context) { |
| 36 | throw new Error('useCarousel must be used within a <Carousel />'); |
| 37 | } |
| 38 | |
| 39 | return context; |
| 40 | } |
| 41 | |
| 42 | const Carousel = React.forwardRef< |
| 43 | HTMLDivElement, |