fix: update Field component to allow description as a function for dynamic content
This commit is contained in:
parent
8b8dfadaa8
commit
c0dd392de0
|
|
@ -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>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue