({
children,
icon,
label,
el = "label",
readOnly,
}: FieldLabelPropsInternal)
| 50 | }; |
| 51 | |
| 52 | export const FieldLabelInternal = ({ |
| 53 | children, |
| 54 | icon, |
| 55 | label, |
| 56 | el = "label", |
| 57 | readOnly, |
| 58 | }: FieldLabelPropsInternal) => { |
| 59 | const overrides = useAppStore((s) => s.overrides); |
| 60 | |
| 61 | const Wrapper = useMemo( |
| 62 | () => overrides.fieldLabel || FieldLabel, |
| 63 | [overrides] |
| 64 | ); |
| 65 | |
| 66 | if (!label) { |
| 67 | return <>{children}</>; |
| 68 | } |
| 69 | |
| 70 | return ( |
| 71 | <Wrapper |
| 72 | label={label} |
| 73 | icon={icon} |
| 74 | className={getClassName({ readOnly })} |
| 75 | readOnly={readOnly} |
| 76 | el={el} |
| 77 | > |
| 78 | {children} |
| 79 | </Wrapper> |
| 80 | ); |
| 81 | }; |
| 82 | |
| 83 | export type FieldPropsInternalOptional<ValueType = any, F = Field<any>> = Omit< |
| 84 | FieldProps<F, ValueType>, |
nothing calls this directly
no test coverage detected