<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";
import InfoTags from "./comunes/InfoTags.vue";
export default {
    name: 'Main',
    components: { InfoTags, 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>
        <info-tags></info-tags>
    </div>
</template>

<style scoped>

</style>
