<template>
  <div class="contest-work-item">
    <a :href="`/contest-work/${contestWork.id}/`">
      <img class="contest-work-item__img" :src="contestWork.image.image_thumbnail" />
    </a>
    <div class="contest-work-item__info">
      <div class="contest-work-item__bio">
        <div>{{ contestWork.child_full_name }}</div>
        <div class="contest-work-item__age">{{ contestWork.age }} {{ contestWork.age < 5 ? 'года' : 'лет' }}</div>
      </div>
      <div class="contest-work-item__likes">
        <likes obj-type="contest_work" :obj-id="contestWork.id" :user-liked="contestWork.user_liked"
               :likes="contestWork.likes"></likes>
      </div>
    </div>
  </div>
</template>

<script>
    import Likes from './Likes.vue';

    export default {
        name: "contest-work",
        props: ['contestWork'],
        components: {Likes},
    }
</script>
