feat: 重构 TradingSimulation 和 Dashboard 组件
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
useToast
|
||||
} from '@chakra-ui/react';
|
||||
import { FiSearch, FiFilter, FiClock, FiTrendingUp, FiTrendingDown } from 'react-icons/fi';
|
||||
import { logger } from '../../../utils/logger';
|
||||
|
||||
export default function TradingHistory({ history, onCancelOrder }) {
|
||||
const [filterType, setFilterType] = useState('ALL'); // ALL, BUY, SELL
|
||||
@@ -147,6 +148,7 @@ export default function TradingHistory({ history, onCancelOrder }) {
|
||||
const handleCancelOrder = async (orderId) => {
|
||||
try {
|
||||
await onCancelOrder(orderId);
|
||||
logger.info('TradingHistory', '撤单成功', { orderId });
|
||||
toast({
|
||||
title: '撤单成功',
|
||||
description: `订单 ${orderId} 已撤销`,
|
||||
@@ -155,6 +157,7 @@ export default function TradingHistory({ history, onCancelOrder }) {
|
||||
isClosable: true,
|
||||
});
|
||||
} catch (error) {
|
||||
logger.error('TradingHistory', 'handleCancelOrder', error, { orderId });
|
||||
toast({
|
||||
title: '撤单失败',
|
||||
description: error.message,
|
||||
|
||||
Reference in New Issue
Block a user