/**
 * @name 还车应结款
 * 设计规范对齐：业务管理 · 租赁合同管理（vm-page / lc-page）
 */
import * as antd from 'antd';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import React, { useEffect } from 'react';
import 'antd/dist/reset.css';
import '../vehicle-management/style.css';
import './styles/index.css';
import { clearHostPrototypeRouteInfo } from '../../common/useHashPage';
import ReturnSettlementApp from './VehicleReturnSettlementApp.jsx';

declare global {
  interface Window {
    React: typeof React;
    antd: typeof antd;
    dayjs: typeof dayjs;
  }
}

window.React = React;
window.antd = antd;
window.dayjs = dayjs;

dayjs.locale('zh-cn');

/** 与租赁合同管理 / 车辆管理主题一致 */
const vmTheme = {
  token: {
    colorPrimary: '#32a06e',
    colorLink: '#32a06e',
    colorLinkHover: '#3fb87c',
    borderRadius: 8,
    fontFamily:
      'Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif',
    fontSize: 14,
    colorText: '#18181b',
    colorTextSecondary: '#52525b',
    colorBorder: '#e5e7eb',
    colorBgContainer: '#ffffff',
  },
  components: {
    Table: {
      headerBg: '#f6f7f7',
      headerColor: '#71717a',
      rowHoverBg: '#f6f7f7',
      borderColor: '#e5e7eb',
      cellPaddingBlock: 6,
      cellPaddingInline: 10,
    },
    Card: {
      borderRadiusLG: 12,
    },
    DatePicker: {
      cellActiveWithRangeBg: 'rgba(50, 160, 110, 0.12)',
      cellHoverWithRangeBg: 'rgba(50, 160, 110, 0.08)',
      cellRangeBorderColor: '#32a06e',
      activeBorderColor: '#32a06e',
      hoverBorderColor: '#3fb87c',
    },
  },
};

export default function VehicleReturnSettlement() {
  useEffect(() => {
    clearHostPrototypeRouteInfo();
  }, []);

  return (
    <ConfigProvider theme={vmTheme} locale={zhCN}>
      <ReturnSettlementApp />
    </ConfigProvider>
  );
}
