import PropTypes from 'prop-types'; import * as React from 'react'; import { useFormContext } from 'react-hook-form'; import Collapse from '@mui/material/Collapse'; import ListItem from '@mui/material/ListItem'; import Button from '@mui/material/Button'; import Stack from '@mui/material/Stack'; import { EditorContext } from 'contexts/Editor'; import FlowSubstepTitle from 'components/FlowSubstepTitle'; import InputCreator from 'components/InputCreator'; import FilterConditions from './FilterConditions'; import { StepPropType, SubstepPropType } from 'propTypes/propTypes'; function FlowSubstep(props) { const { substep, expanded = false, onExpand, onCollapse, onSubmit, step, } = props; const { name, arguments: args } = substep; const editorContext = React.useContext(EditorContext); const formContext = useFormContext(); const validationStatus = formContext.formState.isValid; const onToggle = expanded ? onCollapse : onExpand; return ( {!!args?.length && ( {args.map((argument) => ( ))} )} {step.appKey === 'filter' && } ); } FlowSubstep.propTypes = { substep: SubstepPropType.isRequired, expanded: PropTypes.bool, onExpand: PropTypes.func.isRequired, onCollapse: PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired, step: StepPropType.isRequired, }; export default FlowSubstep;