import { SuccessOutline } from '@fruits-chain/icons-react-native'; import React from 'react'; import { View, Text, TouchableOpacity, Pressable } from 'react-native'; import { BOLD } from '../../common/weight'; import { varCreator as varCreatorButton } from '../button/style'; import CheckboxIcon from '../checkbox/checkbox-icon'; import Flex from '../flex'; import Theme from '../theme'; import type { TreeItemProps } from './interface'; import { varCreator, styleCreator } from './style'; const hitSlop = { left: 8, right: 8 }; const TreeItem: React.FC = ({ tier, indent, switcherIcon, switcherHighlight = true, activeColor, active, multiple, bold, label, renderLabel, labelHighlight, hasChildren, onPressSwitcherIcon, ...restProps }) => { const TOKENS = Theme.useThemeTokens(); const CV = Theme.createVar(TOKENS, varCreator); const CV_BUTTON = Theme.createVar(TOKENS, varCreatorButton); // @ts-ignore const STYLES = Theme.createStyle(CV, styleCreator); const leftJSX = ( {indent ? ( ) : null} {switcherIcon} ); return ( {hasChildren ? ( {leftJSX} ) : ( leftJSX )} {renderLabel ? ( renderLabel({ label, disabled: restProps.disabled, labelHighlight, active, activeColor, }) ) : ( {label} )} {multiple ? ( ) : active ? ( ) : null} ); }; export default TreeItem;