<script setup lang="ts">
import { FieldLabel as ShadcnFieldLabel } from '@/components/core/field';
import UiFieldLabelInfo from './UiFieldLabelInfo.vue';
import type { UiFieldLabelProps } from './types';

defineOptions({
  name: 'UiFieldLabel',
});

const props = defineProps<UiFieldLabelProps>();
</script>

<template>
  <ShadcnFieldLabel :for="props.for">
    <slot />
    <UiFieldLabelInfo
      v-if="props.tooltip"
      :description="props.tooltip"
      :icon="props.tooltipIcon"
    />
  </ShadcnFieldLabel>
</template>
