<template>
  <div class="group-event-page">
    <Back
      :href="{
        name: 'GroupPage',
        params: { slug: fetchedData.slug[0] }
      }"
      size="s"
    >
      {{ $_tr('teams.BACK.back') }}
    </Back>

    <FullContent
      v-bind="getAttrs($attrs)"
      contentType="events"
      config-module="inside-events"
      fieldsContentType="events"
      :filters="requestFilters"
      :use-related-slot="false"
      :printable="false"
      :extraFields="extraRequestFields"
      :content-options="{ scaffoldOverrides: $_scaffoldOverrides }"
      class="full-events-lib-container"
    />
  </div>
</template>

<script>
import FullContent from '@inside-layouts/components/pages/FullContentPage'
import Back from '@inside-commons/components/lib/Back'

import mixin from '../../mixins/register-feedback-forms-mixin'
import { getAttrs } from '@inside-library/helpers/Attrs'

export default {
  name: 'GroupEventPage',
  components: { FullContent, Back },
  mixins: [mixin],
  props: {
    fetchedData: {
      type: Object,
      required: true
    },
    extraFields: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      requestFilters: {
        'slug:eq': this.$route.params.event
      },
      extraRequestFields: [
        'content_type',
        { spaces: ['slug'] },
        { register_forms: ['custom_form_type'] },
        { feedback_forms: ['custom_form_type'] }
      ]
    }
  },
  methods: {
    getAttrs
  }
}
</script>
