<template>
  <div class="dashboard-container">
    <component :is="currentRole" ref="child" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import editorDashboard from './editor'
export default {
  inject: ['reload'],
  name: 'Dashboard',
  components: { editorDashboard },
  data() {
    return {
      currentRole: 'editorDashboard'
    }
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  created() {
    // if (!this.roles.includes('admin')) {
    this.currentRole = 'editorDashboard'
    // }
  },
  mounted() {
    this.$nextTick(() => {
      this.$refs.child.get_table_data()
    })
  },
  methods: {

  }
}
</script>
