'use client'; import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Box, Typography, Chip, CircularProgress } from '@mui/material'; import { useTranslation } from 'react-i18next'; import Image from 'next/image'; import QuestionSelector from './QuestionSelector'; import AnswerInput from './AnswerInput'; export default function AnnotationDialog({ open, onClose, image, templates, selectedTemplate, onTemplateChange, answer, onAnswerChange, onSave, onSaveAndContinue, saving, loading, onOpenCreateQuestion, onOpenCreateTemplate }) { const { t } = useTranslation(); if (!image) return null; return ( {t('images.annotateImage', { defaultValue: '标注图片' })} {image && ( )} {/* 图片预览区域 */} {/* 图片预览 */} {image && ( <> {image.base64 ? ( {image.imageName} ) : ( {t('images.imageLoadError', { defaultValue: '图片加载失败' })} )} {/* 图片信息卡片 */} {image.imageName} {image.width && image.height && ( )} {image.size && ( )} {image.format && } {t('images.annotatedCount', { defaultValue: '已标注' })}: {image.datasetCount || 0}{' '} {t('images.questions', { defaultValue: '个问题' })} )} {/* 标注区域 */} {/* 问题选择器 */} {loading ? ( ) : ( )} {/* 答案输入区域 */} {selectedTemplate && ( )} {/* 左侧:创建按钮 */} {/* 右侧:操作按钮 */} ); }