<template>
  <div
    :class="specialContainerClass"
    class="container skillbox layout">
    <navigation-sidebar/>
    <profile-sidebar/>
    <header-bar class="header layout__header"/>

    <router-view
      :key="$route.fullPath"
      class="layout__content"
    />
    <default-footer
      class="layout__footer"
      v-if="enableFooter"/>
  </div>
</template>

<script>
  import HeaderBar from '@/components/HeaderBar';
  import MobileHeader from '@/components/MobileHeader';
  import ProfileSidebar from '@/components/profile/ProfileSidebar';
  import DefaultFooter from '@/layouts/DefaultFooter';
  import NavigationSidebar from '@/components/book-navigation/NavigationSidebar';
  import enableFooter from '@/helpers/footer';

  export default {
    components: {
      HeaderBar,
      MobileHeader,
      ProfileSidebar,
      NavigationSidebar,
      DefaultFooter
    },

    computed: {
      showFilter() {
        return this.$route.meta.filter;
      },
      specialContainerClass() {
        let cls = this.$store.state.specialContainerClass;
        return [cls ? `layout--${cls}` : '', {'skillbox--show-filter': this.showFilter}];
      },
      enableFooter() {
        return enableFooter() && (!this.$route.meta || !this.$route.meta.hideFooter);
      }
    }
  };
</script>
