import { createContext, useContext } from 'react';

const DropdownContext = createContext(undefined);
const useDropdownContext = () => {
    const context = useContext(DropdownContext);
    if (!context) {
        throw new Error("Dropdown compound components must be used within a Dropdown component");
    }
    return context;
};

export { DropdownContext, useDropdownContext };
