<template>
    <div class="media align-items-center min-width-200"
         @click="stopParentEvent($event)">
        <app-avatar :title="value.full_name"
                    avatar-class="avatars-w-50"
                    :img="$optional(value.profile_picture, 'full_url')"
                    :alt-text="value.full_name"/>
        <div class="media-body ml-3">
            <a v-if="value.full_name" :href="profileUrl" target="_blank">{{ value.full_name }}</a>
            <a v-else :href="profileUrl" target="_blank">{{ value.email }}</a>
        </div>
    </div>
</template>
<script>

    import {urlGenerator} from "../../../../helpers/AxiosHelper";

    export default {
        name: "UserMediaObject",
        props: {
            value: {},
            rowData: {},
            index: {},
        },
        computed: {
            profileUrl() {
                return urlGenerator('/profile/' + this.value.uuid)
            }
        },
        methods: {
            stopParentEvent(e) {
                e.stopPropagation();
            }
        }
    }
</script>