summaryrefslogtreecommitdiff
path: root/src/index.tsx
blob: 49724546aa97daa5ab0e4aa625a62eb94d0de5f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import ReactDOM from 'react-dom';
import 'tailwindcss/tailwind.css';
import {
  BrowserRouter as Router,
  Switch,
  Route,
} from 'react-router-dom';
import Header from './components/Header';
import Home from './containers/Home';
import Products from './containers/Products';
import ProductForm from './containers/ProductForm';

const navigation = [
  { name: 'Главная', route: '/' },
  { name: 'Товары', route: '/products' },
  { name: 'Контрагенты', route: '/contractors' },
  { name: 'Накладные', route: '/waybills' },
];

const App: React.FC = () => (
  <Router>
    <Header navigation={navigation} />
    <Switch>
      <Route exact path="/" component={Home} />
      <Route exact path="/products" component={Products} />
      <Route exact path="/products/add" component={ProductForm} />
    </Switch>
  </Router>
);

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root'),
);