<template>
    <v-menu
        v-model="form.menu.visible"
        :position-x="form.menu.x"
        :position-y="form.menu.y"
        absolute
        offset-y
        :close-on-content-click="false"
    >
        <cs-form-card 
            :form="form"
        >
            <template v-if="action == 'delete'">
                <cs-info-alert 
                    color="red"
                    icon="mdi-alert"
                    :message="__('Sunteți sigur că doriți ștergerea cursului :name?', {
                        name: activeRecord.name
                    })"
                />
            </template>    

        </cs-form-card>
    </v-menu>
</template>

<script>
    export default {
        props: {
            app: {required: true}
        },

        watch: {
            'form.menu.visible': function(newVisible, oldVisible) {
                if(! newVisible)
                {
                    this.form.Hide(true);
                }
            }
        },  

        components: {
            CsFormCard: require('@CsVueComp/cards/CsFormCard').default,
            CsInfoAlert: require('@CsVueComp/sheets/CsInfoAlert').default,
        },

        mixins: [
            require('@MyDpoMix/Entities/Curs/Curs.mixin'),
        ],

        name: 'CursActionMenu',
    }
</script>