<template>
    <div class="chat-info">
        <img class="head" width="50" height="50" v-if="info.userHeadImg == 'default' || !info.userHeadImg" :src="channelInfo.chatAdminAvaUrl">
        <img class="head" width="50" height="50" v-else :src="info.userHeadImg"  alt="">
        <div class="content">
            <div class="username">{{info.userNick}}</div>
            <div class="text">
                <div :style="{color: info.contentColor}" v-html="$options.filters.emojiParse(info.filterContent,30)"></div>
            </div>
        </div>
    </div>
</template>

<script>
    import {mapGetters} from 'vuex'

    export default {
        props: {
            info: {}
        },
        computed: {
            ...mapGetters({
                'channelInfo': 'channelInfo',
            })
        },
    }
</script>

<style lang="less" scoped>
    .chat-info{
        display: flex;
        padding: 0 10px;
        border-bottom: 1px solid #D7D7D7;

        .head{
            flex: 0 0 50px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
        }
        .content{
            flex: 1;
            padding: 5px 0 5px 10px;

            .username{
                line-height: 20px;
                color: #4F4F4F;
                font-weight: 700;
                font-size: 10px;
            }
            .text{
                line-height: 20px;
                color: #8C8C8C;
                font-size: 12px;
            }
        }
    }
</style>