import React from 'react';
import { createRoot } from 'react-dom/client';
import { ThemeProvider } from 'styled-components';
import { App } from './App';
import { GlobalStyle } from './styles/GlobalStyle';
import { theme } from './styles/theme';
import { Provider } from 'react-redux'
import {store} from "./store";
import { YMInitializer } from 'react-yandex-metrika';

const root = document.getElementById('root');

if (!root) {
    throw new Error('Root element #root was not found');
}


createRoot(root).render(
    <Provider store={store}>
        <ThemeProvider theme={theme}>
            <GlobalStyle />
            <App />
        </ThemeProvider>
    </Provider>,
);