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 Service from './containers/Service/Service'; import { ServiceProvider } from './containers/Service/ServiceContext'; import services from './services'; import WaybillForm from './containers/WaybillForm'; import WaybillPanel from './containers/WaybillPanel'; import ContractorForm from './containers/ContractorForm'; import ContractorPanel from './containers/ContractorPanel'; import ProductForm from './containers/ProductForm'; import TransferForm from './containers/TransferForm'; import TransfersUpload from './containers/TransfersUpload'; services[0].Form = ProductForm; services[1].Form = ContractorForm; services[1].Panel = ContractorPanel; services[2].Form = WaybillForm; services[2].Panel = WaybillPanel; services[3].Form = TransferForm; services[3].routes = { upload: TransfersUpload }; const navigation = [ { name: 'Главная', route: '/' }, ...services.map(({ name, route }) => ({ name, route: `/${route}` })), ]; const App: React.FC = () => (
{services.map(service => ( ))} ); ReactDOM.render( , document.getElementById('root'), );