<script setup>
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import { useI18n } from 'vue-i18n';

const $props = defineProps({
    name: { type: String, default: null },
    workerId: { type: Number, default: null },
    defaultName: { type: Boolean, default: false },
});

const { t } = useI18n();
</script>
<template>
    <slot name="link">
        <span :class="{ link: $props.workerId }">
            {{ $props.defaultName ? $props.name ?? t('globals.system') : $props.name }}
        </span>
    </slot>
    <WorkerDescriptorProxy v-if="$props.workerId" :id="$props.workerId" />
</template>
<style scoped></style>
