<template>
    <v-card tile flat :height="height - 2">

        <v-card-text>
            <v-sheet :height="height ? height - 34 : null" class="d-flex flex-wrap">

                <v-sheet 
                    v-for="(registru, index) in registre" 
                    :key="'registru-' + index" 
                    :width="'calc(100%/' + registre.length + ')'" 
                    min-width="360"
                    class="pa-2 mb-2"
                >
                    <registre-dashboard-navigator-item 
                        :registru="registru"
                        :customer="customer"
                        :is_asociat="is_asociat(registru)"
                    />
                </v-sheet>

            </v-sheet>

        </v-card-text>

    </v-card>
</template>

<script>
    export default {

        props: {
            height: {default: null},
            app: {required: true},
            customer: {required: true},
            registre: { default: () => []},
            registreasociate:  { default: () => []},
        },

        methods: {
            is_asociat(registru) {
                let r = _.find(this.registreasociate, item => item.register_id == registru.id);
                return !! r;
            }
        },

        name: 'RegistreDashboardNavigator',
    }
</script>