<template>
    <v-sheet>
        <div v-if="items.length > 0" class="text-caption">
            {{ __('Istoric prelungiri:') }}
        </div>

        <v-chip small outlined label
            v-for="(item, index) in date_to_history"
            :key="'item-' + index"
            class="mr-1 mb-1"
        >
            {{ ToDate(item.date_to) }}
        </v-chip>
    </v-sheet>
</template>

<script>
    export default {
        props: {
            items: {default: () => []},
        },

        computed: {
            date_to_history() {
                let r = this.items;
                r = _.orderBy(r, item => item.date_to, ['desc']);
                return r;
            }
        },
        
        name: 'HistoryList',
    }
</script>