import ThemeProvider from 'features/theme/ThemeProvider';
import { SnackbarProvider } from 'notistack';
import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';

import { StylesProvider } from '@material-ui/core/styles';

import App from './app/App';
import store from './app/store';
import * as serviceWorker from './serviceWorker';

render(
  <Provider store={store}>
    <StylesProvider injectFirst>
      <ThemeProvider>
        <BrowserRouter>
          <SnackbarProvider preventDuplicate>
            <App />
          </SnackbarProvider>
        </BrowserRouter>
      </ThemeProvider>
    </StylesProvider>
  </Provider>,
  document.getElementById('root'),
);

serviceWorker.register();
