♻️ refactor(InvitationCard): restructure cards with title prop and clean up styling

- Move card titles (earnings, total revenue, invitations) to Card title prop for consistency
- Remove custom color classes in favor of Semi-UI's built-in type system
- Standardize Text component usage with strong and tertiary types
- Improve code maintainability and visual consistency across all cards
- Align structure with existing reward description card pattern
This commit is contained in:
t0ng7u
2025-08-19 00:22:28 +08:00
parent 57f1015197
commit 6c94573323
5 changed files with 98 additions and 109 deletions

View File

@@ -18,8 +18,10 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
import { Card, Avatar, Skeleton } from '@douyinfe/semi-ui';
import { Card, Avatar, Skeleton, Tag } from '@douyinfe/semi-ui';
import { VChart } from '@visactor/react-vchart';
import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
const StatsCards = ({
groupedStatsData,
@@ -28,6 +30,8 @@ const StatsCards = ({
CARD_PROPS,
CHART_CONFIG
}) => {
const navigate = useNavigate();
const { t } = useTranslation();
return (
<div className="mb-4">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
@@ -72,7 +76,19 @@ const StatsCards = ({
</div>
</div>
</div>
{(loading || (item.trendData && item.trendData.length > 0)) && (
{item.title === t('当前余额') ? (
<Tag
color="white"
shape='circle'
size="large"
onClick={(e) => {
e.stopPropagation();
navigate('/console/topup');
}}
>
{t('充值')}
</Tag>
) : (loading || (item.trendData && item.trendData.length > 0)) && (
<div className="w-24 h-10">
<VChart
spec={getTrendSpec(item.trendData, item.trendColor)}