summaryrefslogtreecommitdiff
path: root/src/containers/Service/Service.tsx
blob: 3a7cbeeba6c5e7dbc598b9ef11253508b238308d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import React from 'react';
import { Route, Switch, useRouteMatch } from 'react-router-dom';
import ServiceList from './ServiceList';
import ServiceForm from './ServiceForm';


const Service: React.FC = () => {
  const { path } = useRouteMatch();

  return (
    <Switch>
      <Route exact path={path} component={ServiceList} />
      <Route path={`${path}/add`} component={ServiceForm} />
      <Route path={`${path}/edit/:id`} component={ServiceForm} />
    </Switch>
  );
};

export default Service;