import { createContext, useContext } from 'react';

const CarouselContext = createContext(undefined);
const useCarouselContext = () => {
    const context = useContext(CarouselContext);
    if (!context) {
        throw new Error('Carousel compound components must be used within Carousel');
    }
    return context;
};

export { CarouselContext, useCarouselContext };
