<template>
  <Parent
    v-bind="getAttrs($attrs)"
    :extra-categories-config="extraCategoriesConfig"
    :slug="slug"
    :to="{ name: 'NewsPage', params: { slug: slug[0] } }"
    class="minimal-news-custom"
  />
</template>

<script>
import Parent from '@inside-news/components/lib/Minimal'

import { getAttrs } from '@inside-library/helpers/Attrs'

export default {
  name: 'MinimalNews',
  components: { Parent },
  props: {
    slug: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
      extraCategoriesConfig: {
        subsidiaries: {
          data: (data, contentType, { getData }) => getData(data, contentType),
          disabledOn: ['NewsListingPage'],
          href: ({ uuid }) => ({
            name: 'NewsListingPage',
            query: { subsidiaries: uuid }
          })
        }
      }
    }
  },
  methods: {
    getAttrs
  }
}
</script>

<style lang="scss">
.minimal-news-lib-container a.category {
  margin: 0 var(--spacing-m) -6px 0;
}
</style>
