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

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

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

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