PromucFlow_constructor/app/client/src/components/propertyControls/ActionSelectorControl.tsx
2020-06-04 13:49:22 +00:00

30 lines
849 B
TypeScript

import React from "react";
import BaseControl, { ControlProps } from "./BaseControl";
// import DynamicActionCreator from "components/editorComponents/DynamicActionCreator";
import { ActionCreator } from "components/editorComponents/actioncreator/ActionCreator";
class ActionSelectorControl extends BaseControl<ControlProps> {
handleValueUpdate = (newValue: string) => {
const { propertyName } = this.props;
this.updateProperty(propertyName, newValue);
};
render() {
const { propertyValue } = this.props;
return (
<ActionCreator
value={propertyValue}
isValid={this.props.isValid}
validationMessage={this.props.errorMessage}
onValueChange={this.handleValueUpdate}
/>
);
}
static getControlType() {
return "ACTION_SELECTOR";
}
}
export default ActionSelectorControl;