import './App.css';
import {ConfigProvider} from "antd";
import locale from 'antd/locale/zh_CN';
import {useEffect, useState} from "react";
import {BrowserRouter as Router} from "react-router-dom";
import Routers from "./routes";


function App() {

    const [height, setHeight] = useState(window.innerHeight)

    useEffect(() => {
        setHeight(window.innerHeight)
        window.addEventListener('resize', handleResize);
    }, []);

    const handleResize = () => {
        setHeight(window.innerHeight)
    }

    return (
        <ConfigProvider
            theme={{
                token: {
                    colorPrimary: '#980000'
                }
            }}
            locale={locale}>
            <div className="App" style={{height: height}}>
                <Router>
                    <Routers/>
                </Router>
            </div>
        </ConfigProvider>
    );
}

export default App;
