
<template>
  <li class="detail-comments__item">
    <div class="detail-comments-item">
      <div class="detail-comments-item__text">
        <span class="response-user" v-if="commentsItem.response_user">{{ commentsItem.response_user }}, </span>
        <span class="text" v-html="commentsItem.text"></span>
      </div>
      <span class="comment-date"> {{ $convertDate(commentsItem.create) }}, </span><span class="comment-user">{{ commentsItem.user_name }}</span><span class="response-comment" @click="response(commentsItem.user_id, commentsItem.user_name)">Ответить</span>
    </div>
  </li>
</template>

<script>
export default {
  props: {
    commentsItem: {
      type: Object,
    },
  },
  methods: {
    response(userId, userName){
      this.$emit('commentResponse', {user_id: userId, user_name: userName});
    }
  }
};
</script>

<style>
</style>