// REQ-USR-003: 主页落地页根（复刻原型 #screen-main：KPI 头条 + 角色树 + KPI 网格 + 常用操作 + 页脚）。
import { useNavigate } from 'react-router-dom';
import KpiHeadBar from './KpiHeadBar';
import RoleProcessTree from './RoleProcessTree';
import KpiBoard from './KpiBoard';
import CommonOps from './CommonOps';
import AppFooter from '../../../layouts/AppLayout/AppFooter';
import { KPI_STATS, KPI_ROWS, ROLE_GROUPS, PROCESS_GROUPS } from './dashboardData';
import styles from './HomePage.module.css';

export default function HomePage() {
  const navigate = useNavigate();

  return (
    <>
      <div className={styles.home}>
        <div className={styles.mainCol}>
          <KpiHeadBar stats={KPI_STATS} />
          <div className={styles.threeCol}>
            <RoleProcessTree roleGroups={ROLE_GROUPS} processGroups={PROCESS_GROUPS} />
            <div className={styles.center}>
              <div className={styles.panel} style={{ overflow: 'auto' }}>
                <KpiBoard rows={KPI_ROWS} />
              </div>
            </div>
          </div>
        </div>
        <CommonOps onOpenUserList={() => navigate('/usr/users')} />
      </div>
      <AppFooter />
    </>
  );
}
