mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 20:27:44 +00:00
24 lines
531 B
Vue
24 lines
531 B
Vue
<script lang="ts" setup>
|
|
import type { HTMLAttributes } from 'vue'
|
|
import type { LabelProps } from 'radix-vue'
|
|
import { useFormField } from './useFormField'
|
|
import { cn } from '@/lib/utils'
|
|
import { Label } from '@/components/ui/label'
|
|
|
|
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>()
|
|
|
|
const { error, formItemId } = useFormField()
|
|
</script>
|
|
|
|
<template>
|
|
<Label
|
|
:class="cn(
|
|
error && 'text-destructive',
|
|
props.class,
|
|
)"
|
|
:for="formItemId"
|
|
>
|
|
<slot />
|
|
</Label>
|
|
</template>
|