import React from 'react';
import { Provider } from 'react-redux';
import { createBrowserHistory } from 'history';
import { ToastProvider } from 'react-toast-notifications';
import { Router } from 'react-router-dom';
import store from './src/redux/store/store';

const history = createBrowserHistory();

/**
 * @description This is the page wrapper that supplies the instance of redux store to the test element
 * @param {*} param0
 */
export const PageWrapper = ({ children }) => {
  return (
    <ToastProvider>
      <Provider store={store}>
        <Router history={history}>{children}</Router>
      </Provider>
    </ToastProvider>
  );
};
