<template>
  <div class="reward-info">
    <div class="tip">
      感谢
      <em>{{ info.userNick }}</em>
      赠送的
      <img :src="giftImg" />
      {{ gift.name }}
      <em>* {{ gift.num }}</em>
    </div>
  </div>
</template>

<script>
export default {
  name: 'chat-reward-gift',
  props: {
    info: {}
  },
  computed: {
    gift() {
      return JSON.parse(this.info.filterContent || '{}');
    },
    giftImg() {
      return this.gift.img || `${process.env.DEF_OSS}/static/reward/gift-${this.gift.imgType}.png`;
    }
  }
};
</script>

<style lang="less" scoped>
.reward-info {
  text-align: center;
  .tip {
    display: inline-block;
    max-width: 90%;
    line-height: 0.2rem;
    padding: 0.05rem 0.1rem;
    border-radius: 0.05rem;
    font-size: 0.14rem;
    color: #fff;
    background: #edcb91;
    text-align: center;
    em {
      color: #d84e43;
    }
    img {
      vertical-align: middle;
      height: 0.3rem;
    }
  }
}
</style>
