diff options
Diffstat (limited to 'sdc-workflow-designer-ui/src/main/frontend/src/features/catalog/views/StatusSelector.js')
-rw-r--r-- | sdc-workflow-designer-ui/src/main/frontend/src/features/catalog/views/StatusSelector.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sdc-workflow-designer-ui/src/main/frontend/src/features/catalog/views/StatusSelector.js b/sdc-workflow-designer-ui/src/main/frontend/src/features/catalog/views/StatusSelector.js new file mode 100644 index 00000000..5b77bd5d --- /dev/null +++ b/sdc-workflow-designer-ui/src/main/frontend/src/features/catalog/views/StatusSelector.js @@ -0,0 +1,24 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { WORKFLOW_STATUS } from 'features/workflow/workflowConstants'; + +const StatusSelect = ({ status, onChange }) => ( + <select + className="wf-status-select" + value={status} + data-test-id="status-select" + onChange={e => onChange(e.target.value)}> + {Object.keys(WORKFLOW_STATUS).map((type, i) => ( + <option key={`type.${i}`} value={WORKFLOW_STATUS[type]}> + {type} + </option> + ))} + </select> +); + +StatusSelect.propTypes = { + status: PropTypes.string, + onChange: PropTypes.func +}; + +export default StatusSelect; |