import { View } from '@tarojs/components'
import { useMemo } from 'react'
import styles from './index.module.scss'

interface Param {
  name: string
}
export default ({ name = '' }: Param) => {
  const nameLabel = useMemo(() => {
    if (!name) { return '' }
    return name.toString()[0]
  }, [name])
  return <View className={styles.name}>{nameLabel}</View>
}
