import React from 'react'; import { Text, View } from 'react-native'; import type { StyleProp, TextStyle, ViewStyle } from 'react-native'; import { abbr } from '../helpers'; export interface TextAvatarProps { name: string; size: number; textColor?: string; noUpperCase?: boolean; textStyle?: StyleProp; } const TextAvatar = ({ name, size, textColor = '#fff', noUpperCase, textStyle, }: TextAvatarProps) => { const containerStyle: ViewStyle = { flexDirection: 'column', alignItems: 'center', justifyContent: 'center', marginTop: -(size / 20), height: size, width: size, }; return ( {!!name && ( {abbr(name, noUpperCase)} )} ); }; export default TextAvatar;