enabled flag

This commit is contained in:
ari committed 2022-06-12 21:55:32 -04:00
1 parent e3a816f2c8
commit b30f4ed59a
7 files changed
+45 -5

No files matched your search

@@ -9,6 +9,7 @@ import { getDescriptionFromAutomationNode } from 'utils/formatting';
import { useHA } from 'haService';
import { Generic } from './Generic';
import { getNodeTypeAndValidate } from '../../../utils/automations';
import InputBoolean from 'components/Inputs/InputBoolean';
type UseState = <S>(s: S) => [S, Dispatch<SetStateAction<S>>]
@@ -70,8 +71,13 @@ export const useEditorNodeState = (originalNode: AutomationNode, isErrored: bool
get data() {
return currentNode
},
setEnabled(enabled: boolean) {
setState({
...currentNode,
enabled,
})
},
renderOptionList() {
console.log('rendering option list')
let aliasEditor = <></>
if (nodeType === 'trigger') {
aliasEditor = <InputText