<script>
import NavBar from "./comunes/NavBar.vue";
import { mapActions, mapState } from "vuex";
export default {
    name: 'Main',
    components: { NavBar },
    computed: {
        ...mapState('login',["rol"]),
    },
    methods: {
        ...mapActions('login',["getRol"]),
    },
    async mounted() {
        await this.getRol();
    },
}
</script>

<template>
    <div id="main">
        <nav-bar></nav-bar>
        <pedidos-body v-if="rol === 'barrio'"></pedidos-body>
        <admin-body v-if="rol === 'admin_barrio'"></admin-body>
        <compras-body v-if="rol === 'comision'"></compras-body>
    </div>
</template>

<style scoped>

</style>
