import React from 'react'; import { makeStyles } from '@mui/core/styles'; import Typography from '@mui/core/Typography'; import Box from '@mui/core/Box'; import Paper from '@mui/core/Paper'; import Stepper from '@mui/core/Stepper'; import Step from '@mui/core/Step'; import StepLabel from '@mui/core/StepLabel'; import ConfigureDatabaseForm from '../../components/ConfigureDatabaseForm'; import AddExchangeSessionForm from '../../components/AddExchangeSessionForm'; import ReviewSessions from '../../components/ReviewSessions'; import ConfigureGridStrategyForm from '../../components/ConfigureGridStrategyForm'; import ReviewStrategies from '../../components/ReviewStrategies'; import SaveConfigAndRestart from '../../components/SaveConfigAndRestart'; import PlainLayout from '../../layouts/PlainLayout'; const useStyles = makeStyles((theme) => ({ paper: { padding: theme.spacing(2), }, })); const steps = [ 'Configure Database', 'Add Exchange Session', 'Review Sessions', 'Configure Strategy', 'Review Strategies', 'Save Config and Restart', ]; function getStepContent(step, setActiveStep) { switch (step) { case 0: return ( { setActiveStep(1); }} /> ); case 1: return ( { setActiveStep(0); }} onAdded={() => { setActiveStep(2); }} /> ); case 2: return ( { setActiveStep(1); }} onNext={() => { setActiveStep(3); }} /> ); case 3: return ( { setActiveStep(2); }} onAdded={() => { setActiveStep(4); }} /> ); case 4: return ( { setActiveStep(3); }} onNext={() => { setActiveStep(5); }} /> ); case 5: return ( { setActiveStep(4); }} onRestarted={() => {}} /> ); default: throw new Error('Unknown step'); } } export default function Setup() { const classes = useStyles(); const [activeStep, setActiveStep] = React.useState(0); return ( Setup Session {steps.map((label) => ( {label} ))} {getStepContent(activeStep, setActiveStep)} ); }