import React from 'react';
import ReactDOM from 'react-dom';
import { history } from '@wisdom-utils/runtime';
import { Provider } from 'react-redux';
import { ConfigProvider } from 'antd';
import { ConnectedRouter } from 'connected-react-router/immutable';
import { ErrorBoundary, LocaleContainer } from '@wisdom-utils/components';
import store from './stores';
import Container from './components/Container';
import App from './containers/App';
const MOUNT_NODE = document.getElementById('root');
export const render = () => {
  // eslint-disable-next-line react-hooks/rules-of-hooks
  ReactDOM.render(
    <Provider store={store}>
      <ConnectedRouter history={history}>
        <LocaleContainer>
          <ConfigProvider prefixCls="panda-console-base">
            <ErrorBoundary>
              <Container>
                <App />
              </Container>
            </ErrorBoundary>
          </ConfigProvider>
        </LocaleContainer>
      </ConnectedRouter>
    </Provider>,
    MOUNT_NODE,
  );
};
// updateTheme('#ff9600');
const loader = (appContent, loading) => render({ appContent, loading });

export default loader;
