<template>
  <div class="corporate-page">
    <Banner :static-data="fetchedData" :add="['corporates']" />

    <TemplateContainer size="l">
      <TwoColumnsLayout>
        <template #sidebar>
          <Block
            v-if="fetchedData.users.data.length"
            :title="$_tr('TEAMS.title')"
            title-tag="h3"
            class="mb-l"
          >
            <CorporateTeams :users="fetchedData.users.data" class="mb-l" />
          </Block>

          <Block
            v-if="
              fetchedData.website ||
                fetchedData.facebook ||
                fetchedData.twitter ||
                fetchedData.linkedin ||
                fetchedData.instagram
            "
            :title="$_tc('LINKS.title', fetchedData.title)"
            title-tag="h3"
            class="mb-l"
          >
            <CorporateLinks :fetched-data="fetchedData" />
          </Block>

          <Block
            v-if="
              fetchedData.section_website ||
                fetchedData.section_facebook ||
                fetchedData.section_twitter ||
                fetchedData.section_linkedin ||
                fetchedData.section_instagram
            "
            :title="$_tc('LINKS.title', fetchedData.section_title)"
            title-tag="h3"
            class="mb-l"
          >
            <CorporateLinks :fetched-data="fetchedData" />
          </Block>

          <CorporateNews />
        </template>

        <template #main>
          <ParagraphListing
            v-if="fetchedData.content"
            :herited-data="fetchedData.content"
            :herited-options="{ template: true }"
          />
        </template>
      </TwoColumnsLayout>
    </TemplateContainer>
  </div>
</template>

<script>
import Banner from '@inside-commons/components/lib/Banner'
import TemplateContainer from '@inside-commons/components/lib/TemplateContainer'
import TwoColumnsLayout from '@inside-commons/components/lib/TwoColumnsLayout'
import Block from '@inside-commons/components/lib/Block'

import ParagraphListing from '@inside-library/components/listing/ParagraphListing'

import CorporateTeams from '../../components/corporate/CorporateTeams'
import CorporateLinks from '../../components/corporate/CorporateLinks'
import CorporateNews from '../../components/corporate/CorporateNews'

export default {
  name: 'CorporatePage',
  $_i18nRootPath: 'customs.ENTITY',
  components: {
    Banner,
    TemplateContainer,
    TwoColumnsLayout,
    Block,
    ParagraphListing,
    CorporateTeams,
    CorporateLinks,
    CorporateNews
  },
  props: {
    fetchedData: {
      type: Object,
      required: true
    }
  }
}
</script>
