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

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

<style scoped>

</style>
