<template>
    <v-card
        flat
        tile
        outlined
        class="text-caption pa-1"
    >
        <div class="d-flex justify-space-between align-center">
            <div>
                {{ __('Status') }}
            </div>
            <user-active 
                :app="app"
                :user="user"
                :form="null"
            />
        </div>

        <div class="d-flex justify-space-between align-center" v-if="user.type == 'admin'">
            <template v-if="user.active">
                <div>{{ __('Cont activat pentru MyDPO Admin la data')}}</div>
                <div class="font-weight-bold">{{ ToDateTime(user.activated_at) }}</div>
            </template>

            <template v-else>
                <div>{{ __('Cont inactiv')}}</div>
            </template>
        </div>

        <div class="d-flex justify-space-between align-center">
            <div>
                {{__('Ultima logare:')}}
            </div>

            <div class="font-weight-bold">
               {{ user.last_login ? ToDateTime(user.last_login) : '-' }}
            </div>
            
        </div>

        <div class="d-flex justify-space-between align-center">
            <div>
                {{__('Platforma:')}}
            </div>

            <div class="font-weight-bold">
               {{app.config.platforms[user.type]}}
            </div>

            
        </div>

        <div class="d-flex justify-space-between align-center">
            <div>
                {{__('Knolyx ID:')}}
            </div>

            <div class="font-weight-bold">
                {{user.k_id}}
            </div>
        </div>
    </v-card>
</template>

<script>
    export default {

        props: {
            app: {required: true},
            user: {required: true},
            height: {default: 128}
        },

        name: 'UserProfile',
    }
</script>