import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import { ChakraProvider, theme as chakraTheme } from '@chakra-ui/react';
import { Provider } from 'react-redux';

import Routers from './routes';
import ErrorBoundary from './components/ErrorBoundary';
import { store } from './__data__/store';

const App = () => {
  return (
    <Provider store={store}>
      <ChakraProvider theme={chakraTheme}>
        <ErrorBoundary>
          <BrowserRouter>
            <Routers />
          </BrowserRouter>
        </ErrorBoundary>
      </ChakraProvider>
    </Provider>
  );
};

export default App;
