<!-- Мета видео: длительность, просмотры, дата -->
<template>
  <div class="player-info">
    <p class="player-info__meta">
      <span class="player-info__item">
        <UiIcon
          name="show"
          size="16"
        />
        {{ $n(Number(views), 'compact') }}
      </span>
      <span class="player-info__item">
        <UiIcon
          name="date"
          size="16"
        />
        {{ formatTimeAgo }}
      </span>
    </p>
  </div>
</template>

<script setup lang="ts">

const props = defineProps<{
  views: string | number
  created: number
}>();

const { locale } = useI18n();

const formatTimeAgo = computed(() => {
  return useFormatTimeAgo(props.created, locale.value);
});
</script>

<style lang="scss">
.player-info__meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  column-gap: 12px;
  width: max-content;
}

.player-info__item {
  @include font-xs;

  color: $video-info-item-text;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  column-gap: 6px;
  white-space: nowrap;
}
</style>
