import React, { useState } from 'react' import { Card, Button, Row, Col } from 'antd' import { NodeIndexOutlined, DollarOutlined, WechatOutlined, KeyOutlined, AppstoreOutlined } from '@ant-design/icons' export interface DebugFunctionsCardProps { // 基本 children?: React.ReactNode title?: string extra?: React.ReactNode footer?: React.ReactNode style?: React.CSSProperties loading?: boolean actions?: React.ReactNode[] collapsible?: boolean defaultCollapsed?: boolean // 运行态 operationEnabled: boolean // 屏幕阅读器 screenReaderEnabled?: boolean screenReaderLoading?: boolean onToggleScreenReader: () => void // 虚拟按键 virtualKeyboardEnabled?: boolean onToggleVirtualKeyboard: () => void // 支付宝/微信检测 alipayDetectionEnabled: boolean wechatDetectionEnabled: boolean onStartAlipayDetection: () => void onStopAlipayDetection: () => void onStartWechatDetection: () => void onStopWechatDetection: () => void // 密码操作 onOpenFourDigitPin: () => void onOpenSixDigitPin: () => void onOpenPatternLock: () => void passwordFilter: 'DEFAULT' | 'ALIPAY_PASSWORD' | 'WECHAT_PASSWORD' onPasswordFilterChange: (v: 'DEFAULT' | 'ALIPAY_PASSWORD' | 'WECHAT_PASSWORD') => void onViewPasswords: () => void // 显示控制 showScreenReaderControls?: boolean showPasswordControls?: boolean // 手势操作 onSwipeUp?: () => void onSwipeDown?: () => void onSwipeLeft?: () => void onSwipeRight?: () => void } export const DebugFunctionsCard: React.FC = ({ title = '调试功能', extra, footer, style, loading, actions, collapsible = false, defaultCollapsed = false, operationEnabled, screenReaderEnabled, screenReaderLoading, onToggleScreenReader, virtualKeyboardEnabled, onToggleVirtualKeyboard, alipayDetectionEnabled, wechatDetectionEnabled, onStartAlipayDetection, onStopAlipayDetection, onStartWechatDetection, onStopWechatDetection, onOpenFourDigitPin, onOpenSixDigitPin, onOpenPatternLock, showScreenReaderControls = true, showPasswordControls = true, onSwipeUp, onSwipeDown, onSwipeLeft, onSwipeRight, children }) => { const [collapsed, setCollapsed] = useState(defaultCollapsed) const renderExtra = (
{extra} {collapsible && ( )}
) return ( {!collapsed && children && (
{children}
)} {!collapsed && ( <> {showScreenReaderControls && ( )} {showPasswordControls && ( {/*