import React, { useState } from 'react';
import { Card, Row, Col, Statistic, Progress, Button, Space } from 'antd';
import styles from './basic.less';
import OilDataManagement from './components/OilDataManagement';
import CustomerInfoManagement from './components/CustomerInfoManagement';
import DataModeling from './components/DataModeling'; 


const SafeMajorHazardList = () => {
    const [activeModule, setActiveModule] = useState('oilData');

    const handleModuleClick = (module) => {
        setActiveModule(module)
    }

    const renderModule = () => {
        switch (activeModule) {
            case 'oilData':
                return <OilDataManagement />;
            case 'customerInfo':
                return <CustomerInfoManagement />;
            case 'dataModeling':
                return <DataModeling />;
            default:
                return <OilDataManagement />;
        }
    };


    return (
        <div className={styles.container}>
            <div className={styles.TopButton}>
                <Button
                    className={`${styles.TopButtonItem} ${activeModule === "oilData" ? styles.active : ""}`}
                    onClick={() => handleModuleClick("oilData")}
                >油资料管理
                </Button>
                <Button
                    className={`${styles.TopButtonItem} ${activeModule === "customerInfo" ? styles.active : ""}`}
                    onClick={() => handleModuleClick("customerInfo")}
                >客户信息管理
                </Button>
                <Button 
                    className={`${styles.TopButtonItem} ${activeModule === "dataModeling" ? styles.active : ""}`}
                    onClick={() => handleModuleClick("dataModeling")}
                >数据建模
                </Button>
            </div>
            <div className={styles.content}>
                {renderModule()}
            </div>
        </div>
    );
};

export default SafeMajorHazardList;
