import React from 'react' ; import { ChevronDownIcon , ChevronUpIcon } from '../../primitives/Icon/Icons' ; import type { IAccordionIconProps , IAccordionItemContextProps } from './types' ; import { AccordionItemContext } from './Context' ; import { useThemeProps } from '../../../hooks' ; import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps' ; const AccordionIcon = ( { ... props } , ref ? ) => { const { isOpen } = React . useContext ( AccordionItemContext ) ; const { ... newProps } = useThemeProps ( 'AccordionIcon' , props ) ; if ( useHasResponsiveProps ( props ) ) { return null ; } return isOpen ? ( < ChevronUpIcon color = "white" { ... newProps } ref = { ref } / > ) : ( < ChevronDownIcon { ... newProps } ref = { ref } / > ) ; } ; export default React . memo ( React . forwardRef ( AccordionIcon ) ) ;