/**
 * @name 保险采购
 * 自 ONE-OS web端/业务管理/保险采购.jsx 复原
 */
import React, { useMemo } from 'react';
import { ConfigProvider } from 'antd';
import {
  type AnnotationSourceDocument,
  type AnnotationViewerOptions
} from '@axhub/annotation';
import { PrototypeAnnotationHost } from '../../common/prototype-annotation-host';
import 'antd/dist/reset.css';
import './styles/index.css';
import InsuranceProcurement from './InsuranceProcurement.jsx';
import annotationSourceDocument from './annotation-source.json';

/** 与 oneos-tokens.css / Antd设计规范（v5）一致 */
const ipcTheme = {
  token: {
    colorPrimary: '#10b981',
    colorLink: '#10b981',
    colorLinkHover: '#059669',
    colorSuccess: '#10b981',
    colorWarning: '#f59e0b',
    colorError: '#ef4444',
    borderRadius: 8,
    fontFamily:
      'Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif',
    fontSize: 14,
    colorText: '#0f172a',
    colorTextSecondary: '#475569',
    colorTextTertiary: '#64748b',
    colorTextQuaternary: '#94a3b8',
    colorBorder: '#e2e8f0',
    colorBgContainer: '#ffffff',
    colorBgLayout: '#f8fafc',
  },
  components: {
    Table: {
      headerBg: '#f8fafc',
      headerColor: '#475569',
      rowHoverBg: '#f8fafc',
      borderColor: '#e2e8f0',
      cellPaddingBlock: 12,
      cellPaddingInline: 16,
      fontSize: 13,
    },
    Card: {
      borderRadiusLG: 16,
    },
    Button: {
      controlHeight: 32,
      fontWeight: 500,
    },
    Input: {
      controlHeight: 32,
    },
    Select: {
      controlHeight: 32,
    },
  },
};

export default function InsuranceProcurementPage() {
  const annotationOptions = useMemo<AnnotationViewerOptions>(
    () => ({
      showToolbar: true,
      showThemeToggle: true,
      showColorFilter: true,
      emptyWhenNoData: false,
      toolbarEdge: 'right',
      currentPageId: 'list',
    }),
    [],
  );

  return React.createElement(
    React.Fragment,
    null,
    React.createElement(
      ConfigProvider,
      { theme: ipcTheme },
      React.createElement(InsuranceProcurement),
    ),
    React.createElement(PrototypeAnnotationHost, {
      source: annotationSourceDocument as AnnotationSourceDocument,
      options: annotationOptions,
    }),
  );
}
