- 主组件从 Chakra Tabs 迁移到 SubTabContainer - 新增 PeriodSelector 时间选择器组件 - IndustryRankingView 增加深色主题支持 - 拆分出 6 个独立 Tab 组件到 tabs/ 目录 - 类型定义优化,props 改为可选
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
/**
|
|
* 财务指标 Tab
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { FinancialMetricsTable } from '../components';
|
|
import type { FinancialMetricsData } from '../types';
|
|
|
|
export interface MetricsTabProps {
|
|
financialMetrics: FinancialMetricsData[];
|
|
showMetricChart: (name: string, key: string, data: unknown[], path: string) => void;
|
|
calculateYoYChange: (value: number, period: string, data: unknown[], path: string) => { change: number; intensity: number };
|
|
getCellBackground: (change: number, intensity: number) => string;
|
|
positiveColor: string;
|
|
negativeColor: string;
|
|
bgColor: string;
|
|
hoverBg: string;
|
|
}
|
|
|
|
const MetricsTab: React.FC<MetricsTabProps> = ({
|
|
financialMetrics,
|
|
showMetricChart,
|
|
calculateYoYChange,
|
|
getCellBackground,
|
|
positiveColor,
|
|
negativeColor,
|
|
bgColor,
|
|
hoverBg,
|
|
}) => {
|
|
const tableProps = {
|
|
showMetricChart,
|
|
calculateYoYChange,
|
|
getCellBackground,
|
|
positiveColor,
|
|
negativeColor,
|
|
bgColor,
|
|
hoverBg,
|
|
};
|
|
|
|
return <FinancialMetricsTable data={financialMetrics} {...tableProps} />;
|
|
};
|
|
|
|
export default MetricsTab;
|