import {Route, Switch} from 'react-router-dom';
import React from 'react';
import Loading from '../utility/loading';
import CategoryList from './categoryList';
import CategoryForm from './categoryForm';

const CategoryPage = () => {
    return (
        <React.Suspense fallback={<Loading/>}>
            <Switch>
                <Route exact path="/categories" component={CategoryList}/>
                <Route exact path="/categories/form" component={CategoryForm}/>
                <Route path="/categories/form/:id" component={CategoryForm}/>
            </Switch>
        </React.Suspense>
    )
}

export default CategoryPage;
