import React from 'react' import type { DebugInfo } from '../types' interface DebugDialogProps { isOpen: boolean debugInfo: DebugInfo | null onClose: () => void } export const DebugDialog: React.FC = ({ isOpen, debugInfo, onClose }) => { if (!isOpen || !debugInfo) return null return (
e.stopPropagation()} >

调试信息

{debugInfo.error ? (
{debugInfo.error}
) : (
)}
) } const InfoGrid: React.FC<{ debugInfo: DebugInfo }> = ({ debugInfo }) => (
) const InfoItem: React.FC<{ label: string value: string | null isSmall?: boolean }> = ({ label, value, isSmall }) => (
{label}
{value || '(未检测到)'}
) const ImagePreview: React.FC<{ debugInfo: DebugInfo }> = ({ debugInfo }) => { if (!debugInfo.bookCover && !debugInfo.userAvatar) return null return (
图片
{debugInfo.bookCover && (
书籍封面
cover
)} {debugInfo.userAvatar && (
用户头像
avatar
)}
) } const TocInfo: React.FC<{ toc: string | null }> = ({ toc }) => { if (!toc) return null return (
目录信息
        {toc}
      
) } const UrlInfo: React.FC<{ url: string }> = ({ url }) => (
当前 URL
{url || '(空)'}
) const DomInfo: React.FC<{ domInfo: string | null }> = ({ domInfo }) => (
DOM 结构信息
      {domInfo}
    
)