feat: add analytics summary API, dashboard page with stats grid, and blog post detail page.

This commit is contained in:
Timo
2026-01-02 18:40:51 +01:00
parent 0302821f0f
commit d0a114c1c3
4 changed files with 51 additions and 18 deletions

View File

@@ -67,9 +67,9 @@ export const StatsGrid: React.FC<StatsGridProps> = ({ stats, trends }) => {
),
},
{
title: t('dashboard.stats.conversion_rate'),
title: 'Unique Scan Rate',
value: `${stats.conversionRate}%`,
change: stats.totalScans > 0 ? `${stats.conversionRate}% rate` : 'No scans yet',
change: stats.totalScans > 0 ? `${stats.conversionRate}% new users` : 'No scans yet',
changeType: stats.conversionRate > 0 ? 'positive' : 'neutral' as 'positive' | 'negative' | 'neutral',
icon: (
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -88,11 +88,10 @@ export const StatsGrid: React.FC<StatsGridProps> = ({ stats, trends }) => {
<div>
<p className="text-sm text-gray-600 mb-1">{card.title}</p>
<p className="text-2xl font-bold text-gray-900">{card.value}</p>
<p className={`text-sm mt-2 ${
card.changeType === 'positive' ? 'text-success-600' :
<p className={`text-sm mt-2 ${card.changeType === 'positive' ? 'text-success-600' :
card.changeType === 'negative' ? 'text-red-600' :
'text-gray-500'
}`}>
'text-gray-500'
}`}>
{card.change}
</p>
</div>