Docker images / prepare-release (push) Successful in 5s
Docker images / backend-image (push) Successful in 2m37s
Docker images / frontend-image (push) Successful in 2m22s
Docker images / updater-image (push) Successful in 38s
Docker images / notify-webhook (push) Has been skipped
Docker images / publish-release (push) Successful in 8s
32 lines
721 B
TypeScript
32 lines
721 B
TypeScript
"use client"
|
|
|
|
import {
|
|
Field,
|
|
FieldDescription,
|
|
FieldLabel,
|
|
} from "@/components/ui/field"
|
|
|
|
interface FormFieldProps {
|
|
label: string
|
|
hint?: string
|
|
error?: string
|
|
required?: boolean
|
|
children: React.ReactNode
|
|
}
|
|
|
|
function FormField({ label, hint, error, required, children }: FormFieldProps) {
|
|
return (
|
|
<Field data-invalid={!!error}>
|
|
<FieldLabel>
|
|
{label}
|
|
{required && <span className="text-destructive ml-0.5">*</span>}
|
|
</FieldLabel>
|
|
{children}
|
|
{hint && !error && <FieldDescription>{hint}</FieldDescription>}
|
|
{error && <FieldDescription className="text-destructive">{error}</FieldDescription>}
|
|
</Field>
|
|
)
|
|
}
|
|
|
|
export { FormField, type FormFieldProps }
|