import React from 'react'; import { Box, Typography, Paper, List, ListItem, ListItemText, ListItemIcon, Collapse, Button, Stack, CircularProgress, } from '@mui/material'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; import FolderIcon from '@mui/icons-material/Folder'; import DownloadIcon from '@mui/icons-material/Download'; import UploadIcon from '@mui/icons-material/Upload'; import { DataTemplate } from '@/utils/dataTemplate'; interface TemplateManagerProps { templates: DataTemplate[]; showTemplates: boolean; templateLoading: boolean; onToggleShowTemplates: () => void; onLoadTemplates: () => void; onExportTemplates: () => void; onImportTemplates: () => void; } const TemplateManager: React.FC = ({ templates, showTemplates, templateLoading, onToggleShowTemplates, onLoadTemplates, onExportTemplates, onImportTemplates, }) => { const handleToggle = () => { onToggleShowTemplates(); if (!showTemplates) onLoadTemplates(); }; return ( 模板管理 ({templates.length}) {showTemplates ? : } {templateLoading ? ( ) : templates.length === 0 ? ( 暂无模板,请先在其他页面创建模板 ) : ( {templates.map((template) => ( ))} )} ); }; export default TemplateManager;