2023-11-27 18:46:31 +04:00
|
|
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
|
|
import React from 'react';
|
|
|
|
import ReactDOM from 'react-dom/client';
|
|
|
|
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
|
|
|
|
import App from './App.jsx';
|
|
|
|
import './index.css';
|
|
|
|
import ErrorPage from './pages/ErrorPage.jsx';
|
|
|
|
import MainPage from './pages/MainPage.jsx';
|
|
|
|
import Chanel from './pages/Chanel.jsx';
|
|
|
|
import Login from './pages/Login.jsx';
|
|
|
|
import Register from './pages/Register.jsx';
|
|
|
|
import Admin from './pages/Admin.jsx';
|
|
|
|
import Repair from './pages/Repair.jsx';
|
|
|
|
import Search from './pages/Search.jsx';
|
|
|
|
import Watch from './pages/Watch.jsx';
|
2024-01-07 21:44:00 +04:00
|
|
|
import Redact from './pages/Redact.jsx';
|
2023-11-27 18:46:31 +04:00
|
|
|
|
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
index: true,
|
|
|
|
path: '/',
|
|
|
|
element: <MainPage />,
|
|
|
|
title: 'Главная страница',
|
|
|
|
},
|
|
|
|
{
|
2024-01-07 21:44:00 +04:00
|
|
|
path: '/chanel/:id?',
|
2023-11-27 18:46:31 +04:00
|
|
|
element: <Chanel />,
|
2024-01-07 21:44:00 +04:00
|
|
|
title: 'Канал',
|
2023-11-27 18:46:31 +04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
element: <Login />,
|
2024-01-07 21:44:00 +04:00
|
|
|
title: 'Вход',
|
2023-11-27 18:46:31 +04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/regist',
|
|
|
|
element: <Register />,
|
2024-01-07 21:44:00 +04:00
|
|
|
title: 'Регистрация',
|
2023-11-27 18:46:31 +04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/admin',
|
|
|
|
element: <Admin />,
|
2024-01-07 21:44:00 +04:00
|
|
|
title: 'Админ Панель',
|
2023-11-27 18:46:31 +04:00
|
|
|
},
|
|
|
|
{
|
2024-01-07 21:44:00 +04:00
|
|
|
path: '/account',
|
2023-11-27 18:46:31 +04:00
|
|
|
element: <Repair />,
|
2024-01-07 21:44:00 +04:00
|
|
|
title: 'Аккаунт',
|
2023-11-27 18:46:31 +04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/search',
|
|
|
|
element: <Search />,
|
2024-01-07 21:44:00 +04:00
|
|
|
title: 'Поиск',
|
2023-11-27 18:46:31 +04:00
|
|
|
},
|
|
|
|
{
|
2024-01-07 21:44:00 +04:00
|
|
|
path: '/watch/:id?',
|
2023-11-27 18:46:31 +04:00
|
|
|
element: <Watch />,
|
2024-01-07 21:44:00 +04:00
|
|
|
title: 'Видео',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/redact/:id?',
|
|
|
|
element: <Redact />,
|
2023-11-27 18:46:31 +04:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: '/',
|
|
|
|
element: <App routes={routes} />,
|
|
|
|
children: routes,
|
|
|
|
errorElement: <ErrorPage />,
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
|
|
<React.StrictMode>
|
|
|
|
<RouterProvider router={router} />
|
|
|
|
</React.StrictMode>,
|
|
|
|
);
|