import Switch from 'react-bootstrap/Switch';
import {Route} from 'react-router-dom';
import RobotList from './robotList';
import Loading from '../utility/loading';
import React from 'react';
import RobotForm from './robotForm';

const RobotPage = () => {
    return (
        <React.Suspense fallback={<Loading/>}>
            <Switch>
                <Route exact path="/robots" component={RobotList}/>
                <Route path="/robots/form/:id" component={RobotForm}/>
                <Route exact path="/robots/form" component={RobotForm}/>
            </Switch>
        </React.Suspense>
    )
}

export default RobotPage;
