import React from 'react' ; import { AccordionContext , AccordionItemContext } from './Context' ; import Collapse from '../Collapse' ; import type { IAccordionDetailsProps , IAccordionContextProps , IAccordionItemContextProps , } from './types' ; import { useThemeProps } from '../../../hooks' ; import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps' ; const AccordionDetails = ( { children , ... props } , ref ? ) => { const { ... newProps } = useThemeProps ( 'AccordionDetails' , props ) ; const { isOpen } = React . useContext ( AccordionItemContext ) ; const { AnimationProps } = React . useContext ( AccordionContext ) ; if ( useHasResponsiveProps ( props ) ) { return null ; } return ( < Collapse { ... AnimationProps } { ... newProps } isOpen = { isOpen } ref = { ref } > { children } < /Collapse>); } ; export default React . memo ( React . forwardRef ( AccordionDetails ) ) ;