/* * @Author: ZhaoYing * @Date: 2026-02-03 16:28:03 * @Last Modified by: ZhaoYing * @Last Modified time: 2026-02-25 13:55:11 */ /** * Line chart card component for displaying statistics * Uses ECharts to render time-series data with gradient area fill */ import { type FC } from 'react' import { useTranslation } from 'react-i18next' import type { StatisticsItem } from '../types' import RbCard from '@/components/RbCard/Card'; import AreaLineChart from '@/components/Charts/AreaLineChart' import BarChart from '@/components/Charts/BarChart' /** * Component props */ interface ChartCardProps { /** Chart data points */ chartData: StatisticsItem[]; /** Statistics type key */ type: string; /** Total count to display */ total: number; } /** * Color mapping for different statistic types */ const ColorObj: Record = { daily_conversations: '#155EEF', daily_new_users: '#9C6FFF', daily_api_calls: '#155EEF', daily_tokens: '#FF8A4C' } /** * Line chart card component * Displays time-series statistics with gradient area chart */ const ChartCard: FC = ({ chartData, type, total }) => { const { t } = useTranslation() return ( {total}} headerType="borderless" headerClassName="rb:min-h-26!" >
{type === 'daily_conversations' || type === 'daily_tokens' ? ( ) : }
) } export default ChartCard