import { useRoutes, Outlet, BrowserRouter } from 'react-router-dom'; import Header from './components/common/Header'; import CustomerPage from './components/pages/customerPage'; import StorePage from './components/pages/storePage'; import ProductPage from './components/pages/productPage'; import OrderPage from './components/pages/orderPage'; import AddToStorePage from './components/pages/addToStorePage' import './styleSite.css'; function Router(props) { return useRoutes(props.rootRoute); } export default function App() { const routes = [ { index: true, element: }, { path: 'customer', element: , label:'Покупатели'}, { path: 'store', element: , label: 'Магазины' }, { path: 'product', element: , label: 'Товары' }, { path: 'order', element: , label: 'Заказы'}, { path: 'addToStore', element: , label: 'Доставка'} ]; const links = routes.filter(route => route.hasOwnProperty('label')); const rootRoute = [ { path: '/', element: render(links), children: routes } ]; function render(links) { console.info('render links'); return ( <>
); } return ( ); }