빌드에러수정
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import * as React from "react";
|
||||
import type { ReactNode } from "react";
|
||||
import type { ControllerRenderProps, FieldError, FieldValues } from "react-hook-form";
|
||||
import { FormUi } from "@common/business_components/ui";
|
||||
import type { ReactNode } from "react";
|
||||
import type { ControllerRenderProps, FieldError, FieldValues, Path } from "react-hook-form";
|
||||
|
||||
|
||||
interface AccessibleFormFieldProps<T extends FieldValues> {
|
||||
field: ControllerRenderProps<T, any>;
|
||||
field: ControllerRenderProps<T, Path<T>>;
|
||||
label: string;
|
||||
required?: boolean;
|
||||
error?: FieldError;
|
||||
@@ -19,15 +18,10 @@ export function AccessibleFormField<T extends FieldValues>({
|
||||
error,
|
||||
inputComponent,
|
||||
}: AccessibleFormFieldProps<T>) {
|
||||
const labelText = required ? `${label} *` : label;
|
||||
|
||||
return (
|
||||
<FormUi
|
||||
label={
|
||||
<span>
|
||||
<span className="text-black">{label}</span>
|
||||
{required && <span className="text-red-500"> *</span>}
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<FormUi label={labelText}>
|
||||
<div>
|
||||
{inputComponent}
|
||||
{error?.message && Array.from(new Set(error.message.split('\n'))).map((msg, idx) => (
|
||||
|
||||
Reference in New Issue
Block a user