adds DictComponent to GenericComponent

This commit is contained in:
Mose Müller
2024-04-22 19:11:23 +02:00
parent d40d9c5e47
commit 2df1a673ac

View File

@ -14,6 +14,7 @@ import { LevelName } from './NotificationsComponent';
import { getIdFromFullAccessPath } from '../utils/stringUtils'; import { getIdFromFullAccessPath } from '../utils/stringUtils';
import { WebSettingsContext } from '../WebSettings'; import { WebSettingsContext } from '../WebSettings';
import { updateValue } from '../socket'; import { updateValue } from '../socket';
import { DictComponent } from './DictComponent';
type AttributeType = type AttributeType =
| 'str' | 'str'
@ -22,6 +23,7 @@ type AttributeType =
| 'int' | 'int'
| 'Quantity' | 'Quantity'
| 'list' | 'list'
| 'dict'
| 'method' | 'method'
| 'DataService' | 'DataService'
| 'DeviceConnection' | 'DeviceConnection'
@ -212,6 +214,16 @@ export const GenericComponent = React.memo(
id={id} id={id}
/> />
); );
} else if (attribute.type === 'dict') {
return (
<DictComponent
value={attribute.value as Record<string, SerializedValue>}
docString={attribute.doc}
isInstantUpdate={isInstantUpdate}
addNotification={addNotification}
id={id}
/>
);
} else if (attribute.type === 'Image') { } else if (attribute.type === 'Image') {
return ( return (
<ImageComponent <ImageComponent