From a72e4799327d47ef02bdea223ded6142135bc158 Mon Sep 17 00:00:00 2001 From: rizrmd Date: Wed, 20 Mar 2024 03:41:04 -0700 Subject: [PATCH] wip fix --- comps/form/Field.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/comps/form/Field.tsx b/comps/form/Field.tsx index 496351a..3aa86e4 100755 --- a/comps/form/Field.tsx +++ b/comps/form/Field.tsx @@ -8,7 +8,7 @@ import { } from "@/comps/ui/form"; import { useLocal } from "@/utils/use-local"; import autosize from "autosize"; -import { FC, useEffect, useRef } from "react"; +import { FC, ReactNode, useEffect, useRef } from "react"; import { UseFormReturn } from "react-hook-form"; import { Button } from "../ui/button"; import { Input } from "../ui/input"; @@ -43,6 +43,7 @@ export const Field: FC<{ PassProp: any; custom: "y" | "n"; child: any; + label_alt: ReactNode | (() => ReactNode); }> = ({ name, form, @@ -56,6 +57,7 @@ export const Field: FC<{ PassProp, custom, child, + label_alt, }) => { const value = form?.hook.getValues()[name]; const local = useLocal({ @@ -126,9 +128,16 @@ export const Field: FC<{ name={name} render={({ field }) => ( - - {label} - {required === "y" &&

*

} + +
+ {label} + {required === "y" && ( +

*

+ )} +
+
+ {typeof label_alt === "function" ? label_alt() : label_alt} +
<>