import { Provider } from 'react-redux';
import { RouterProvider } from 'react-router-dom';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import { store } from './store';
import { router } from './router';
import './styles/tokens.css';
import './styles/global.css';

// AntD ConfigProvider 的 token 需 hex 值；与 docs/06 § 2.1 + tokens.css `--color-primary` 同源
const theme = {
  token: {
    colorPrimary: '#1677ff',
  },
};

export default function App() {
  return (
    <Provider store={store}>
      <ConfigProvider locale={zhCN} theme={theme}>
        <RouterProvider router={router} />
      </ConfigProvider>
    </Provider>
  );
}
