<script setup lang="ts">
import type { XErrors } from '~/types/error'

defineProps<{
  id?: string
  errors?: XErrors
}>()
</script>

<template>
  <div class="grow">
    <slot />
    <div v-if="id && errors?.[id]" class="field-error-info">
      {{ errors[id]?.message }}
    </div>
  </div>
</template>
