<script setup>
defineProps({
    label: {
        type: String,
        required: true,
    },
    error: {
        type: String,
        default: '',
    },
    help: {
        type: String,
        default: '',
    },
});
</script>

<template>
    <label class="block space-y-1.5">
        <span class="text-sm font-medium text-gray-700">{{ label }}</span>
        <slot />
        <p v-if="help && !error" class="text-xs text-gray-500">{{ help }}</p>
        <p v-if="error" class="text-xs font-medium text-red-600">{{ error }}</p>
    </label>
</template>

