({ text }: Props)
| 32 | } |
| 33 | |
| 34 | export default function Emoji({ text }: Props) { |
| 35 | if (!text) { |
| 36 | return null; |
| 37 | } |
| 38 | const name = unwrap(text); |
| 39 | // @ts-ignore |
| 40 | if (EMOJIS[name]) { |
| 41 | // @ts-ignore |
| 42 | return <>{EMOJIS[name]}</>; |
| 43 | } |
| 44 | const letter = getLetter(name); |
| 45 | const color = getColor(letter); |
| 46 | return ( |
| 47 | <span |
| 48 | className={classNames(styles.unknown, { |
| 49 | [styles[`color-${color}`]]: color, |
| 50 | })} |
| 51 | > |
| 52 | {title(name)} |
| 53 | </span> |
| 54 | ); |
| 55 | } |