mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
- Extract shared chart constants to constants/charts.ts - Add TREND_STYLES to stats/constants.ts for reuse - Fix useChartColors with MutationObserver for theme changes - Fix DailyChart date parsing to prevent timezone shift - Add truncate to StatCard value for overflow safety - Fix CampaignCard copy feedback inside try block - Add NaN validation and staleTime to AdminCampaignStats - Replace hardcoded strings with i18n keys in Referral page - Add missing i18n keys across all 4 locales (en, ru, zh, fa) - Add sales stats route to AdminPanel and App router
30 lines
651 B
TypeScript
30 lines
651 B
TypeScript
import { type ReactNode } from 'react';
|
|
|
|
const DEFAULT_VALUE_CLASS = 'text-dark-100';
|
|
|
|
interface StatCardProps {
|
|
label: string;
|
|
value: string | number;
|
|
icon?: ReactNode;
|
|
valueClassName?: string;
|
|
}
|
|
|
|
export function StatCard({
|
|
label,
|
|
value,
|
|
icon,
|
|
valueClassName = DEFAULT_VALUE_CLASS,
|
|
}: StatCardProps) {
|
|
return (
|
|
<div className="rounded-xl bg-dark-800/30 p-3">
|
|
<div className="flex items-center gap-1.5 text-sm text-dark-500">
|
|
{icon}
|
|
<span>{label}</span>
|
|
</div>
|
|
<div className={`mt-1 truncate text-base font-semibold sm:text-lg ${valueClassName}`}>
|
|
{value}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|