// REQ-USR-004: 应用根（Provider + Router + AntD ConfigProvider + App 上下文）
import { ConfigProvider, App as AntdApp } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import { store } from './store/store';
import AppRouter from './router';
import { readPrimaryColor } from './styles/theme';

export default function App() {
  return (
    <Provider store={store}>
      <ConfigProvider
        locale={zhCN}
        theme={{ token: { colorPrimary: readPrimaryColor() } }}
      >
        <AntdApp>
          <BrowserRouter>
            <AppRouter />
          </BrowserRouter>
        </AntdApp>
      </ConfigProvider>
    </Provider>
  );
}
