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";

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

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


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