import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { getRouterBasename } from '@dukang/weixin-sdk';
import { installClientErrorReporting } from '@dukang/client-logging';
import App from './App';
import { initUserAnalytics } from './lib/analytics';
import { apiBase } from './lib/api';
import './styles.css';
import './styles/legal.css';

installClientErrorReporting({ apiBase, clientApp: 'USER_H5' });
initUserAnalytics();

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <BrowserRouter basename={getRouterBasename()}>
      <App />
    </BrowserRouter>
  </React.StrictMode>,
);
