<template>
    <v-menu
        v-model="menu.visible"
        :position-x="menu.x"
        :position-y="menu.y"
        absolute
        offset-y
        :close-on-content-click="false"
        :close-on-click="false"
    >
        <v-card
            tile
            flat
            :width="width"
            :disabled="disabled"
        >
            <v-card-title>
                {{ __('Trimitere curs') }}
            </v-card-title>

            <v-divider></v-divider>

            <v-sheet
                :height="height"
                class="overflow-y-auto"
            >
                <v-card-text class="pa-1">
                    Param pam pam
                </v-card-text>
            </v-sheet>

            <v-divider></v-divider>

            <v-card-actions>

                <cs-btn 
                    caption="Trimite"
                    icon="mdi-minus"
                    color="red"
                    outlined
                    tooltip="Confirmă trimiterea"
                    :loading="false"
                    :disabled="false"
                    @click="OnClickTrimite"
                />

                <v-spacer></v-spacer>

                <cs-btn 
                    caption="Renunță"
                    icon="mdi-close"
                    @click="OnClickCancel"
                />
            </v-card-actions>
        </v-card>
    </v-menu>
</template>

<script>
    export default {
        props: {
            app: {required: true},
            menu: {required: true},
            width: {default: 800},
            height: {default: 460},
            disabled: {default: false},
        },

        watch: {
            'menu.visible': function() {
                if(this.menu.visible)
                {
                    // this.LoadCursuri();
                }
            }
        },

        methods: {
            OnClickTrimite(e) {
                alert('Bam bam ....');
            },

            // LoadCursuri() {
            //     this.app.dataSession.Customercursurifiles.GetByCustomerCursId(this.menu.customercurs.id);
            // },

            OnClickCancel() {
                this.menu.visible = false;
                this.app.dataSession.Cursuriatasate.GetByCustomerId(this.app.payload.customer_id);
            }
        },

        components: {
            CsBtn: require('@CsVueComp/buttons/CsBtn').default,
        },

        name: 'SendCursuriMenu'
    }
</script>