<template>
    <v-card
        tile
        flat
        :height="height"
        class="overflow-y-auto"
        :width="width"
    >
        <v-card-title class="pa-1">
            {{__('Curs :name', {name: curs.name}) }}
        </v-card-title>

        <v-card-text class="pa-1">

            <curs-perioada-valabilitate 
                :curs="curs"
            />

            <v-sheet
                class="mt-3 py-1"
                v-if="trimitere"
            >
                <div class="d-flex">
                    <div class="mr-2">
                        {{ __('Trimiterea #:number', {number: trimitere.number})}}
                    </div>

                    <div>
                        {{ ToDate(trimitere.date) }}
                    </div>
                </div>

                <div>
                    {{ __('Trimitere efectuată de') }}
                    <user-by-id 
                        :id="trimitere.created_by"
                    />
                </div>

                <curs-perioada-completare 
                    :trimitere="trimitere"
                />

                
            </v-sheet>

        </v-card-text>
    </v-card>
</template>

<script>
    export default {
        props: {
            app: {required: true},
            height: {default: null},
            width: {default: 320},
        },

        computed: {
            cursatasat() {
                return this.app.dataSession.Cursuriatasate.cursatasat;
            },

            curs() {
                return this.cursatasat.curs;
            },

            trimitere() {
                return this.app.dataSession.Share.items.length ? this.app.dataSession.Share.items[0] : null; 
            }
        },

        created() {
            this.app.dataSession.Share.GetById(this.cursatasat.trimitere_id);
        },

        name: 'AccesCursCursDetails',
    }
</script>