import React, { forwardRef } from 'react'; import { View, Text, Animated } from 'react-native'; import { useThemeFactory } from '../Theme'; import Cell from '../Cell'; import type { CollapseItemProps } from './type'; import { createStyle } from './style'; const CollapseItem = forwardRef((props, ref) => { const { children, disabled, readonly, style, expanded = false, isLink = true, onExpand, ...rest } = props; const { styles } = useThemeFactory(createStyle); const onPressTitle = () => { if (!disabled && !readonly) { onExpand?.(!expanded); } }; return ( {expanded && ( {children} )} ); }); export default CollapseItem;