<template>
    <v-card
        v-if="isEmailVerified"
        tile
        flat
        :outlined="false"
        :height="app.height"
        :width="400"
        :color="null"
        class="mx-auto d-flex align-center"
    >
        <verified-thank-you 
            :app="app"
        />
    </v-card>

    <customer-dashboard-page 
        v-else
        :app="app" 
        :customer="ACTIVECUSTOMER"
        :dashboardItems="dashboardItems"
    />
   
</template>

<script>
    /**
     * ACTIVECUSTOMER
     * app.platform
     * app.user
     * app.user.roles
     * app.user.active
     * app.user.role
     * app.user.customers
     * 
     * customer-dashboard-page
     *  - customerul
     *  - itemurile "dashboard" din baza de date
     *  - permite click pe un item
     *          se pune in activeDashboardItem = item
     *          si se merge pe pagina customer-dashboard-active-page
     * 
     * customer-dashboard-active-page
     *   - contine componenta customer-dashboard-active-page-container
     *          - aici stim dashboardItem = itemul clickuit
     *                          - dashboardItem.props.app - contine componenta ce se efiseaza
     *                          De exemplu: customer-documents, customer-cursuri etc
     */
    export default {
        props: {
            app: {required: true},
        },

        computed: {
            controller() {
                return this.app.classes.Controller;
            },

            dashboardItems() {
                return this.app.dataSession.Dashboarditems.items;
            },

            isEmailVerified() {
                return _.has(this.app.payload, 'verified') && (this.app.payload.verified == 1)
            }
        },

        name: 'MyDashboardPage',
    }
</script>