import React from 'react'; import { Spin, Typography, Tooltip, Button } from 'antd'; import { CloseOutlined } from '@ant-design/icons'; import type { VfsEntry } from '../../../api/client'; import { viewerStyles } from '../styles'; interface ImageCanvasProps { containerRef: React.RefObject; imageRef: React.RefObject; viewerStyle: React.CSSProperties; controls: React.ReactNode; scaleLabel: string; imageStyle: React.CSSProperties; loading: boolean; error?: string; imageUrl?: string; activeEntry: VfsEntry; onRequestClose: () => void; onImageLoad: () => void; onWheel: React.WheelEventHandler; onMouseDown: React.MouseEventHandler; onMouseMove: React.MouseEventHandler; onMouseLeave: React.MouseEventHandler; onMouseUp: React.MouseEventHandler; onDoubleClick: React.MouseEventHandler; onTouchStart: React.TouchEventHandler; onTouchMove: React.TouchEventHandler; onTouchEnd: React.TouchEventHandler; } export const ImageCanvas: React.FC = ({ containerRef, imageRef, viewerStyle, controls, scaleLabel, imageStyle, loading, error, imageUrl, activeEntry, onRequestClose, onImageLoad, onWheel, onMouseDown, onMouseMove, onMouseLeave, onMouseUp, onDoubleClick, onTouchStart, onTouchMove, onTouchEnd, }) => (
{loading ? ( ) : error ? ( {error} ) : imageUrl ? ( {activeEntry.name} ) : ( 无可用内容 )}
{scaleLabel}
{controls}
);