'use client'; import { useState } from 'react'; import { Dialog, DialogTitle, DialogContent, DialogActions, Button, FormControl, FormLabel, RadioGroup, FormControlLabel, Radio, Box, Divider } from '@mui/material'; import { useTranslation } from 'react-i18next'; import DownloadIcon from '@mui/icons-material/Download'; export default function ExportQuestionsDialog({ open, onClose, onExport, selectedCount, totalCount }) { const { t } = useTranslation(); const [format, setFormat] = useState('json'); const [exportScope, setExportScope] = useState('all'); const handleExport = () => { const exportOptions = { format, selectedIds: exportScope === 'selected' ? [] : undefined }; onExport(exportOptions); onClose(); }; return ( {t('questions.exportQuestions')} {/* 导出范围 */} {t('questions.exportScope')} setExportScope(e.target.value)}> } label={t('questions.exportAll', { count: totalCount })} /> {selectedCount > 0 && ( } label={t('questions.exportSelected', { count: selectedCount })} /> )} {/* 导出格式 */} {t('questions.exportFormat')} setFormat(e.target.value)}> } label="JSON" /> } label="JSONL" /> } label={t('questions.txtFormat')} /> } label="CSV" /> ); }