import { useContext } from 'react';
import { IconThemeContext } from '../IconThemeContext';
/**
 * Hook to get icons for a component with fallback to defaults.
 *
 * @example
 * import { CaretDown, CaretRight } from '@wix/wix-ui-icons-common/system';
 *
 * const icons = useIcons('AccordionItemCaret', { CaretDown, CaretRight });
 * // icons.CaretDown is either the override or the default
 */
export const useIcons = (componentName, defaults) => {
    const { icons } = useContext(IconThemeContext);
    const overrides = icons[componentName];
    if (!overrides) {
        return defaults;
    }
    return { ...defaults, ...overrides };
};
//# sourceMappingURL=useIcons.js.map