import { emoji } from '@/services/config'; import React from 'react'; type IProps = { content: string; }; export const EmojiFormat: React.FC = (props) => { const format = () => { let txt = props.content; if (txt.includes('[') && txt.includes(']')) { emoji.forEach((item) => { const reg = new RegExp(`\\[${item}\\]`, 'g'); txt = txt.replace( reg, ``, ); }); } return txt; }; return ( <> {typeof props.content === 'string' ? (
) : ( props.content )} ); };