import React from 'react'; import { Text, View } from 'react-native'; import Badge from '../Badge'; import TouchableOpacity from '../TouchableOpacity'; import { useThemeFactory } from '../Theme'; import type { ActionBarIconProps } from './type'; import { createIconStyle } from './style'; const ActionBarIcon: React.FC = props => { const { styles, theme } = useThemeFactory(createIconStyle); const { badge, icon } = props; const renderIcon = () => { return badge ? {icon} : icon; }; return ( {renderIcon()} {props.children || props.text} ); }; export default ActionBarIcon;