import React from 'react';
import { Route, Switch, useRouteMatch } from 'react-router-dom';
import ServiceList from './ServiceList';
import ServiceItem from './ServiceItem';


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

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

export default Service;
