<template>
    <v-container fluid>
        <v-layout row wrap>
            <a
                :href="module.href"
                :class="'flex ' + module.main_class"
                v-for="( module ,key ) in getModules"
                :key="key"
            >
                <wm-tile
                    :TileClass="module.title_class"
                    :TitleEn="module.title_en"
                    :TitleFa="module.title_fa"
                    :GradientBegin="module.gradient_begin"
                    :GradientEnd="module.gradient_end"
                    :ImageURL="module.img_url"
                    :ImageHeight="module.img_height"
                ></wm-tile>
            </a>
        </v-layout>
        <router-link v-if="getAuthUser.is_owner == 'true'" :to="{name: 'AddModule'}">
            <v-btn large fab color="cyan" fixed bottom left dark style="left:5%">
                <v-icon dark>fas fa-plus</v-icon>
            </v-btn>
        </router-link>
    </v-container>
</template>



<script>
import Tile from "@Global/components/Tiles/Tile";
import { mapGetters, mapActions } from "vuex";
export default {
    data: () => ({}),
    components: {
        "wm-tile": Tile,
    },
    computed: {
        ...mapGetters("role_permission", ["getModules"]),
        ...mapGetters("auth", ["getAuthUser"]),
    },
    methods: {
        ...mapActions("role_permission", ["loadModules"]),
    },
    created() {
        this.loadModules({ home_page: true });
    }
};
</script>

<style scoped lang="scss">
</style>
