'use client'; import { Container, Typography, Box, Card, useTheme, alpha } from '@mui/material'; import { Chat as ChatIcon } from '@mui/icons-material'; import { useTranslation } from 'react-i18next'; // 导入拆分后的组件 import SearchBar from './components/SearchBar'; import ConversationTable from './components/ConversationTable'; import FilterDialog from './components/FilterDialog'; import { useMultiTurnData } from './hooks/useMultiTurnData'; export default function MultiTurnDatasetPage({ params }) { const { t } = useTranslation(); const theme = useTheme(); const { projectId } = params; // 使用自定义Hook管理状态和逻辑 const { conversations, loading, page, rowsPerPage, total, searchKeyword, filterDialogOpen, exportLoading, filters, selectedIds, isAllSelected, batchDeleteLoading, setSearchKeyword, setFilterDialogOpen, setFilters, fetchConversations, handleExport, handleDelete, handleView, applyFilters, resetFilters, handleSearch, handlePageChange, handleRowsPerPageChange, handleBatchDelete, handleSelectionChange, handleSelectAll } = useMultiTurnData(projectId); return ( {/* {t('datasets.multiTurnConversations')} */} setFilterDialogOpen(true)} onExportClick={handleExport} exportLoading={exportLoading} selectedCount={isAllSelected ? total : selectedIds.length} onBatchDelete={handleBatchDelete} batchDeleteLoading={batchDeleteLoading} /> setFilterDialogOpen(false)} filters={filters} onFiltersChange={setFilters} onReset={resetFilters} onApply={applyFilters} /> ); }