MVP
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import React from 'react';
|
||||
import { Card, CardContent } from '@/components/ui/Card';
|
||||
import { formatNumber } from '@/lib/utils';
|
||||
import { useTranslation } from '@/hooks/useTranslation';
|
||||
|
||||
interface StatsGridProps {
|
||||
stats: {
|
||||
@@ -13,12 +14,13 @@ interface StatsGridProps {
|
||||
}
|
||||
|
||||
export const StatsGrid: React.FC<StatsGridProps> = ({ stats }) => {
|
||||
const { t } = useTranslation();
|
||||
// Only show growth if there are actual scans
|
||||
const showGrowth = stats.totalScans > 0;
|
||||
|
||||
|
||||
const cards = [
|
||||
{
|
||||
title: 'Total Scans',
|
||||
title: t('dashboard.stats.total_scans'),
|
||||
value: formatNumber(stats.totalScans),
|
||||
change: showGrowth ? '+12%' : 'No data yet',
|
||||
changeType: showGrowth ? 'positive' : 'neutral' as 'positive' | 'negative' | 'neutral',
|
||||
@@ -30,7 +32,7 @@ export const StatsGrid: React.FC<StatsGridProps> = ({ stats }) => {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Active QR Codes',
|
||||
title: t('dashboard.stats.active_codes'),
|
||||
value: stats.activeQRCodes.toString(),
|
||||
change: stats.activeQRCodes > 0 ? `${stats.activeQRCodes} active` : 'Create your first',
|
||||
changeType: stats.activeQRCodes > 0 ? 'positive' : 'neutral' as 'positive' | 'negative' | 'neutral',
|
||||
@@ -41,7 +43,7 @@ export const StatsGrid: React.FC<StatsGridProps> = ({ stats }) => {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Conversion Rate',
|
||||
title: t('dashboard.stats.conversion_rate'),
|
||||
value: `${stats.conversionRate}%`,
|
||||
change: stats.totalScans > 0 ? `${stats.conversionRate}% rate` : 'No scans yet',
|
||||
changeType: stats.conversionRate > 0 ? 'positive' : 'neutral' as 'positive' | 'negative' | 'neutral',
|
||||
|
||||
Reference in New Issue
Block a user