Updated forms

This commit is contained in:
2025-06-28 00:21:10 +02:00
parent 4ac986745d
commit 7bd43b8e3f
4 changed files with 18 additions and 11 deletions

View File

@@ -81,8 +81,12 @@ function FormItem({ className, ...props }: React.ComponentProps<"div">) {
function FormLabel({
className,
required,
children,
...props
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
}: React.ComponentProps<typeof LabelPrimitive.Root> & {
required?: boolean
}) {
const { error, formItemId } = useFormField()
return (
@@ -92,7 +96,10 @@ function FormLabel({
className={cn("data-[error=true]:text-destructive", className)}
htmlFor={formItemId}
{...props}
/>
>
{children}
{required && <span className="text-destructive">*</span>}
</Label>
)
}