<template>
    <v-sheet
        outlined
        class="pa-1"
    >
        <div class="font-weight-bold">
            {{customer.name}}
        </div>

        <v-chip
            v-for="(user, index) in myusers"
            :key="'user-' + index"
            class="mr-1 mb-1"
        >
            {{ user.full_name  }}
        </v-chip>
    </v-sheet>
</template>

<script>
    export default {
        props: {
            customer: {required: true},
            usersids: {required: true},
            users: {required: true},
        },

        computed: {
            myusers() {
                let r = _.map(this.usersids, user_id => {
                    return _.find(this.users, user => user.id == user_id)
                });

                return _.orderBy(r, [item => item.full_name], ['asc'])
            }
        },

        name: 'ShareDetailsMenuCustomer',
    }
</script>