<template>
  <ParentPage
    :document-types="documentTypes"
    :folder-types="folderTypes"
    :link-types="null"
  />
</template>

<script>
import { CONTENTS } from '@inside-ged/constants/default-contents'

import ParentPage from '@inside-ged/components/pages/GedPage'

import checkManagerAccess from '../../mixins/check-manager-access'

const managerContents = CONTENTS({
  folderContents: ['manager_spaces_folders'],
  documentsContents: ['manager_spaces_documents']
})

export default {
  name: 'GedManagerPage',
  $_i18nRootPath: 'customs.GED',
  components: {
    ParentPage
  },
  mixins: [checkManagerAccess],
  computed: {
    folderTypes() {
      return managerContents.folders
    },
    documentTypes() {
      return managerContents.documents
    }
  },
  beforeMount() {
    if (!this.$_checkManagerAccess) {
      this.$router.push({ name: 'HomePage' })
    }
  }
}
</script>
