<template>
  <div class="msg-time">{{showTime}}</div>
</template>

<script>
import { formatMsgTime } from '@/util/util'

export default {
  name: 'msgTime',
  props: {
    timestamp: {
      type: [String, Number],
      required: true
    }
  },
  computed: {
    showTime () {
      return formatMsgTime(this.timestamp, 2, this)
    }
  }
}
</script>

<style lang="scss" scoped>
.msg-time{
  text-align: center;
  margin: 0 auto 10px;
  max-width: 50%;
  font-size: 12px;
  padding: 1px 18px;
  color: #b2b2b2;
}
</style>
