perf(FinancialPanorama): Tab 组件添加 memo 优化

- MetricsCategoryTab: 使用共享主题,主组件和 7 个子组件添加 memo
- BalanceSheetTab: 添加 memo
- IncomeStatementTab: 添加 memo
- CashflowTab: 添加 memo
- FinancialMetricsTab: 添加 memo
- 减少不必要的重渲染

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zdl
2025-12-19 14:44:32 +08:00
parent 54cce55c29
commit 41da6fa372
5 changed files with 41 additions and 109 deletions

View File

@@ -2,7 +2,7 @@
* 现金流量表 Tab
*/
import React from 'react';
import React, { memo } from 'react';
import { Box, VStack, HStack, Heading, Badge, Text, Spinner, Center } from '@chakra-ui/react';
import { CashflowTable } from '../components';
import type { CashflowData } from '../types';
@@ -19,7 +19,7 @@ export interface CashflowTabProps {
hoverBg: string;
}
const CashflowTab: React.FC<CashflowTabProps> = ({
const CashflowTabInner: React.FC<CashflowTabProps> = ({
cashflow,
loading,
showMetricChart,
@@ -72,4 +72,5 @@ const CashflowTab: React.FC<CashflowTabProps> = ({
);
};
const CashflowTab = memo(CashflowTabInner);
export default CashflowTab;