import React from 'react'; import { Box, Typography, Paper, List, ListItem, ListItemText, Collapse, Chip, Divider, } from '@mui/material'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; interface OperationHistoryItem { time: string; type: string; content: string; result: string; } interface OperationHistoryProps { history: OperationHistoryItem[]; showHistory: boolean; onToggleShowHistory: () => void; } const OperationHistory: React.FC = ({ history, showHistory, onToggleShowHistory, }) => { if (history.length === 0) return null; return ( 操作历史 ({history.length}) {showHistory ? : } {history.map((item, index) => ( {index > 0 && } {item.content} } secondary={`${item.time} · ${item.result}`} /> ))} ); }; export default OperationHistory;