fix: update Field component to allow description as a function for dynamic content

This commit is contained in:
faisolavolut 2025-03-14 09:48:03 +07:00
parent 8b8dfadaa8
commit c0dd392de0
1 changed files with 4 additions and 2 deletions

View File

@ -69,7 +69,7 @@ export interface FieldProps {
visibleLabel?: boolean;
autoRefresh?: boolean;
forceDisabled?: boolean;
description?: string;
description?: string | (() => any);
}
export const Field: React.FC<FieldProps> = ({
fm,
@ -516,7 +516,9 @@ export const Field: React.FC<FieldProps> = ({
</div>
</TooltipBetter>
{description ? (
<div className="text-xs text-gray-500 py-1">{description}</div>
<div className="text-xs text-gray-500 py-1">
{typeof description === "function" ? description() : description}
</div>
) : (
<></>
)}