<!-- +-------------------------------------------------+
 - © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
 - +-------------------------------------------------+
 - $Id: SourceBadge.vue,v 1.1 2026/07/16 gneveu Exp $
-->
<template>
    <span class="prefillingform-badge" :class="'prefillingform-badge-' + variant">
        {{ label }}
    </span>
</template>

<script>
const VARIANTS = {
    z: 'source',
    d: 'extrait',
    i: 'genere',
};

const LABEL_KEYS = {
    source: 'prefillingform_badge_source',
    extrait: 'prefillingform_badge_extrait',
    genere: 'prefillingform_badge_genere',
};

export default {
    props: {
        badge: {
            type: String,
            required: true,
        },
    },
    computed: {
        variant: function () {
            return VARIANTS[this.badge] || 'source';
        },
        label: function () {
            return this.messages.get('prefillingform_admin', LABEL_KEYS[this.variant]);
        },
    },
};
</script>
