The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/lib/utils/renderEmoji.ts

14 lines
512 B

import { emoji } from '../../../app/emoji/lib/rocketchat';
const emojiList = emoji.list as Record<string, { emojiPackage: string }>;
const emojiPackages = emoji.packages as Record<string, { render(emojiName: string): string }>;
export const renderEmoji = (emojiName: string): string | undefined => {
const emojiPackageName = emojiList[emojiName]?.emojiPackage;
if (emojiPackageName) {
const emojiPackage = emojiPackages[emojiPackageName];
return emojiPackage.render(emojiName);
}
return undefined;
};