<template>

    <span v-if="entity.type === 'person'" class="badge rounded-pill bg-person">
        {{ $t('person') }}
    </span>

    <span v-if="entity.type === 'thirdparty'" class="badge rounded-pill bg-thirdparty">
        <template v-if="options.displayLong !== true">
            {{ $t('thirdparty.thirdparty')}}
        </template>

        <i class="fa fa-fw fa-user" v-if="entity.kind === 'child'"></i>
        <i class="fa fa-fw fa-hospital-o" v-else-if="entity.kind === 'company'"></i>
        <i class="fa fa-fw fa-user-md" v-else></i>

        <template v-if="options.displayLong === true">
            <span v-if="entity.kind === 'child'">{{ $t('thirdparty.child')}}</span>
            <span v-else-if="entity.kind === 'company'">{{ $t('thirdparty.company')}}</span>
            <span v-else>{{ $t('thirdparty.contact')}}</span>
        </template>
    </span>

    <span v-if="entity.type === 'user'" class="badge rounded-pill bg-user">
        {{ $t('user')}}
    </span>

</template>

<script>
export default {
    name: "BadgeEntity",
    props: ['options', 'entity'],
    i18n: {
        messages: {
            fr: {
                person: "Usager",
                thirdparty: {
                    thirdparty: "Tiers",
                    child: "Personne de contact",
                    company: "Personne morale",
                    contact: "Personne physique",
                },
                user: 'TMS'
            }
        }
    }
}
</script>
