<template>
  <div class="heronews">
    <div class="title-holder">
      <div class="row">
        <div class="col-12 col-md-6 view-img">
          <img class="image" :src="data.thumbCover" :alt="data.title">
        </div>
        <div class="col-12 col-md-6">
<!--          <h2 class="title" :title="data.summaryTitle">{{ data.summaryTitle }}</h2>-->
          <p class="paragraph titr" :title="data.title">{{ data.title }}</p>
          <p class="paragraph lid" :title="data.leadTitle">{{ data.leadTitle }}</p>
          <span class="s1-date">
             {{ jData2(data.customDate) }}
          </span>
          <nuxt-link class="btn btn-primary" :to="{name: 'portal-news-details',params: {portal: $route.params.portal,details: data._id}}">ادامه مطلب</nuxt-link>
        </div>
      </div>
    </div>
  </div>
</template>


<script>
import moment from "moment-jalaali"

export default {
  props: {
    data: {
      required: true
    }
  },
  methods: {
    jData(data) {
      return moment(data).locale('fa').format('LL')
    },
    jData2(data) {
      return moment(data).locale('fa').fromNow()
    }
  }
}
</script>
