()
| 43 | export const CarouselContext = createContext<CarouselContextProps | null>(null); |
| 44 | |
| 45 | export const useCarousel = () => { |
| 46 | const context = useContext(CarouselContext); |
| 47 | |
| 48 | if (!context) { |
| 49 | throw new Error("The `useCarousel` hook must be used within a <Carousel />"); |
| 50 | } |
| 51 | |
| 52 | return context; |
| 53 | }; |
| 54 | |
| 55 | const CarouselRoot = ({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }: ComponentPropsWithRef<"div"> & CarouselProps) => { |
| 56 | const [carouselRef, api] = useEmblaCarousel( |
no outgoing calls
no test coverage detected