import { useMemo } from 'react' import PropTypes from 'prop-types' import ObjectInfo from '../../common/ObjectInfo' import NewObjectForm from '../../common/NewObjectForm' import WizardView from '../../common/WizardView' const NewGCodeFile = ({ onOk, defaultValues, slicerIntegration = false, shouldPrint = false, currentStep, onStepChange }) => { const initialValues = useMemo( () => ({ state: { type: 'draft' }, ...defaultValues }), [defaultValues] ) return ( {({ handleSubmit, submitLoading, objectData, formValid }) => { const steps = [ ...(!slicerIntegration ? [ { title: 'Upload', key: 'upload', content: ( ) } ] : []), { title: 'Required', key: 'required', content: ( ) }, { title: 'Summary', key: 'summary', content: ( ) } ] return ( { const result = await handleSubmit() if (result) { onOk(result) } }} /> ) }} ) } NewGCodeFile.propTypes = { onOk: PropTypes.func.isRequired, reset: PropTypes.bool, defaultValues: PropTypes.object, slicerIntegration: PropTypes.bool, currentStep: PropTypes.number, onStepChange: PropTypes.func, shouldPrint: PropTypes.bool } export default NewGCodeFile