<script setup lang="ts">
export interface XError {
  message: string
  [key: string]: any
}

defineProps<{
  id?: string
  errors?: Record<string, XError>
}>()
</script>

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