import React from 'react'; import { removeVS16s, toCodePoints } from 'soapbox/utils/emoji'; import { joinPublicPath } from 'soapbox/utils/static'; interface IEmoji extends React.ImgHTMLAttributes { /** Unicode emoji character. */ emoji?: string } /** A single emoji image. */ const Emoji: React.FC = (props): JSX.Element | null => { const { emoji, alt, src, ...rest } = props; let filename; if (emoji) { const codepoints = toCodePoints(removeVS16s(emoji)); filename = codepoints.join('-'); } if (!filename && !src) return null; return ( {alt ); }; export default Emoji;