<template>
    <v-tooltip 
        bottom 
        color="bg-dark-blue"
    >
        <template #activator="{ on: onTooltip }">
            <v-hover v-slot="{ hover }">
                <v-btn 
                    icon 
                    rounded
                    small
                    class="header-btn mr-1"
                    :class="{
                        'bg-orange': hover,
                    }" 
                    v-on="onTooltip"
                    @click="OnClickEmailIcon"
                >
                    <v-img
                        :src="$url + 'imgs/layout/icon-email.png'"
                        height="26"
                        contain
                    />
                </v-btn>
            </v-hover>
        </template>

        <span class="text-caption">
            {{ __('Trimite-ne un email') }}
        </span>
    </v-tooltip>
</template>

<script>
    export default {

        methods: {
            OnClickEmailIcon() {
                if(_.has(this.$config.sysconfig, 'default-email') )
                {
                    document.location = "mailto:" + this.$config.sysconfig['default-email'];
                }
            },
        },

        name: 'EmailIcon',        
    }
</script>