import icons from './icons';
export default str => {
  let text = str;
  for (const key in icons) {
    if (icons[key]) {
      const reg = new RegExp(`#${icons[key]}#`, 'ig');
      text = text.replace(
        reg,
        `<img class="emoji" src="${process.env.DEF_OSS}/static/emoji/newqq/${key}.gif">`
      );
    }
  }
  return text;
};
