<template>
  <aside class="sidebar-ged">
    <div class="sidebar-ged__title" @click="goRootFolder">
      <i class="sid2-house" />

      <p>{{ $_tr('library') }}</p>
    </div>

    <ul class="sidebar-ged__menu">
      <FolderGed
        v-for="folder in heritedData"
        :key="folder.uuid"
        :folder-data="folder"
      />
    </ul>
  </aside>
</template>

<script>
import GEDNavigationMixin from '../mixins/ged-navigation-mixin'
import RequestMixin from '@inside-library/mixins/request-mixin'

import FolderGed from './FolderGed'

export default {
  name: 'SidebarGed',
  $_i18nRootPath: 'customs.GED.sidebar',
  components: {
    FolderGed
  },
  mixins: [RequestMixin, GEDNavigationMixin],
  methods: {
    goRootFolder() {
      this.setStoreAction('setGEDHome', true)

      this.requestFolder({
        data: {
          slug: this.$route.params.folder
        }
      })
    }
  }
}
</script>

<style lang="scss">
@use '../../../styles/modules/inside-customs/ged/sidebar.scss' as *;
</style>
