import * as React from 'react'; import ContainerProperties from '../../Interfaces/Properties'; interface IPropertiesProps { properties?: ContainerProperties onChange: (key: string, value: string) => void } export class Properties extends React.PureComponent { public render(): JSX.Element { if (this.props.properties === undefined) { return
; } const groupInput: React.ReactNode[] = []; Object .entries(this.props.properties) .forEach((pair) => this.handleProperties(pair, groupInput)); return (
{ groupInput }
); } public handleProperties = ( [key, value]: [string, string | number], groupInput: React.ReactNode[] ): void => { const id = `property-${key}`; const type = 'text'; const isDisabled = key === 'id' || key === 'parentId'; // hardcoded groupInput.push(
this.props.onChange(key, event.target.value)} disabled={isDisabled} />
); }; }