From c0dd392de06f54842c2657c053def34616d29549 Mon Sep 17 00:00:00 2001 From: faisolavolut Date: Fri, 14 Mar 2025 09:48:03 +0700 Subject: [PATCH] fix: update Field component to allow description as a function for dynamic content --- components/form/Field.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/form/Field.tsx b/components/form/Field.tsx index 854f10e..f40ea98 100644 --- a/components/form/Field.tsx +++ b/components/form/Field.tsx @@ -69,7 +69,7 @@ export interface FieldProps { visibleLabel?: boolean; autoRefresh?: boolean; forceDisabled?: boolean; - description?: string; + description?: string | (() => any); } export const Field: React.FC = ({ fm, @@ -516,7 +516,9 @@ export const Field: React.FC = ({ {description ? ( -
{description}
+
+ {typeof description === "function" ? description() : description} +
) : ( <> )}