import { IconColorVariantsType } from 'icons/types'; import { useCallback } from 'react'; import { useTheme } from '../useTheme'; export const useIcon = (): IconType => { const { theme } = useTheme(); const getIconColor = useCallback( (colorVariant: IconColorVariantsType) => { const color = theme.colors[colorVariant] || theme.colors.body; return color; }, [theme.colors] ); return { getIconColor }; }; interface IconType { getIconColor: (colorVariant: IconColorVariantsType) => string; }