<template>
    <v-dialog v-model="modal" :width="width" :transition="transition">
        <component v-if="modal" :is="name" />
    </v-dialog>
</template>


<script>
    import {mapGetters} from "vuex";

    export default {
        props: {
            width:{default: '60%'},
            name:{default: ''},
            transition:{default: 'slide-x-transition'},
        },
        data:() => ({
        }),
        components:{
            'modal_task_list': () => '@Common/components/Task/Timeline/Modal-Layout.vue',
            'modal_task_add': () => '@Common/components/Task/AddEdit/Modal-Add.vue'
        },
        computed: {
            ...mapGetters("modal", ["isModalStack"]),
            modal: {
                get() {
                    return this.isModalStack(this.name);
                },
                set(value) {
                    if (!value) {
                        this.$_closeModal();
                    }
                }
            },
        },

    }
</script>
