import React from 'react'; import { StyleProp, TextStyle } from 'react-native'; import { CustomIcon, IconSet, TIconsName } from '../CustomIcon'; import { STATUS_COLORS } from '../../lib/constants'; import { IStatus } from './definition'; const Status = React.memo(({ style, status = 'offline', size = 32, ...props }: Omit) => { const name: TIconsName = `status-${status}`; const isNameValid = IconSet.hasIcon(name); const iconName = isNameValid ? name : 'status-offline'; const calculatedStyle: StyleProp = [ { width: size, height: size, textAlignVertical: 'center' }, style ]; return ( ); }); export default Status;