import { FormGroup, FormGroupProps } from "@patternfly/react-core"; import { PropsWithChildren, ReactNode } from "react"; import { FieldError, FieldValues, Merge } from "react-hook-form"; import { FormErrorText } from "./FormErrorText"; import { HelpItem } from "./HelpItem"; export type FieldProps = { label?: string; name: string; labelIcon?: string | ReactNode; error?: FieldError | Merge; isRequired: boolean; }; type FormLabelProps = FieldProps & Omit; export const FormLabel = ({ name, label, labelIcon, error, children, ...rest }: PropsWithChildren) => ( ) : undefined } {...rest} > {children} {error && ( )} );