import { Icon, Label } from '@fluentui/react'; import { memo, PropsWithChildren, ReactElement } from 'react'; import React from "react"; import { IFormItem, ValidationMark, IFormItemPropertyOptions, IDynamicPropertyComponentConfig } from '@wiberg/formbuilder'; interface IProps { hideLabel?: boolean; validationMark?: ValidationMark; propertySchema: IFormItemPropertyOptions>; parentKey?: string; } const FluentPropertyLabelComp = (props: PropsWithChildren>) : ReactElement | null => { return (
{ !props.hideLabel && } { (!props.hideLabel && props.propertySchema.description) && }
) } const preventUpdate = (prev: any, next: any) => { return prev.labelText === next.labelText; } export const FluentPropertyLabel = memo(FluentPropertyLabelComp, preventUpdate) as typeof FluentPropertyLabelComp;