mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
refactor(cabinet): unify all statistics onto the shared StatCard
Bring every stat strip across the admin panel and user cabinet onto the canonical StatCard (icon chip + label-on-top + tone-coloured value), matching the sales/Remnawave style the rest of the app already used. - Convert ~20 hand-rolled stat strips across 21 pages/components - Remove 4 divergent local StatCard components (Dashboard, Users, BanSystem, Payments) and migrate Remnawave's local StatCard (33 cards) - Extend StatCard with optional subValue, loading skeleton, trailing slot, and icon-size normalisation (all backward-compatible) - StatsGrid nav tiles now use StatCard while keeping link/chevron/loading - Preserve all data, i18n keys, conditionals and interactive filters; fix the dead 'info' colour by mapping it to accent
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SendIcon } from '@/components/icons';
|
||||
import { GiftIcon, SendIcon } from '@/components/icons';
|
||||
import { StatCard } from '@/components/stats';
|
||||
import { useCurrency } from '../../../hooks/useCurrency';
|
||||
import type { AdminUserGiftItem, AdminUserGiftsResponse } from '../../../api/adminUsers';
|
||||
|
||||
@@ -208,18 +209,18 @@ export function GiftsTab({ giftsLoading, giftsData, locale, onNavigateToUser }:
|
||||
<div className="space-y-6">
|
||||
{/* Summary counters */}
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<div className="rounded-xl bg-dark-800/50 p-4">
|
||||
<div className="mb-1 text-xs text-dark-500">
|
||||
{t('admin.users.detail.gifts.totalSent')}
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-accent-400">{giftsData.sent_total}</div>
|
||||
</div>
|
||||
<div className="rounded-xl bg-dark-800/50 p-4">
|
||||
<div className="mb-1 text-xs text-dark-500">
|
||||
{t('admin.users.detail.gifts.totalReceived')}
|
||||
</div>
|
||||
<div className="text-2xl font-bold text-success-400">{giftsData.received_total}</div>
|
||||
</div>
|
||||
<StatCard
|
||||
label={t('admin.users.detail.gifts.totalSent')}
|
||||
value={giftsData.sent_total}
|
||||
icon={<GiftIcon className="h-5 w-5" />}
|
||||
tone="accent"
|
||||
/>
|
||||
<StatCard
|
||||
label={t('admin.users.detail.gifts.totalReceived')}
|
||||
value={giftsData.received_total}
|
||||
icon={<GiftIcon className="h-5 w-5" />}
|
||||
tone="success"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Sent Gifts */}
|
||||
|
||||
Reference in New Issue
Block a user