'use client'; import { useRouter } from 'next/navigation'; import { BarChart2, Users, Eye, Clock, TrendingUp, TrendingDown, LogOut } from 'lucide-react'; import { useTranslations, useLocale } from 'next-intl'; import { createClient } from '@/lib/supabase/client'; interface MetricCard { title: string; value: string; subtitle: string; trend?: 'up' | 'down'; trendValue?: string; icon: React.ReactNode; } export default function DashboardContent() { const t = useTranslations('dashboard'); const locale = useLocale(); const router = useRouter(); const handleLogout = async () => { const supabase = createClient(); await supabase.auth.signOut(); router.push(`/${locale}`); }; const metrics: MetricCard[] = [ { title: t('metrics.pageViews.title'), value: '12,543', subtitle: '45 ' + t('metrics.pageViews.perMinute'), trend: 'up', trendValue: '+12.5%', icon: , }, { title: t('metrics.uniqueVisitors.title'), value: '3,721', subtitle: '127 ' + t('metrics.uniqueVisitors.currentlyActive'), trend: 'up', trendValue: '+8.2%', icon: , }, { title: t('metrics.conversions.title'), value: '156', subtitle: '4.2% ' + t('metrics.conversions.rate'), trend: 'down', trendValue: '-2.1%', icon: , }, { title: t('metrics.timeOnSite.title'), value: '4:32', subtitle: '32% ' + t('metrics.timeOnSite.bounceRate'), trend: 'up', trendValue: '+15.3%', icon: , }, ]; const topPages = [ { path: '/', views: 4521, change: '+12%' }, { path: '/portfolio', views: 2341, change: '+8%' }, { path: '/about', views: 1823, change: '+5%' }, { path: '/blog', views: 1456, change: '-2%' }, { path: '/contact', views: 892, change: '+3%' }, ]; return (
{/* Header */}

{t('header.title')}

127 {t('header.activeUsers')}

{/* Metrics Grid */}
{metrics.map((metric, index) => (
{metric.icon}
{metric.trend && (
{metric.trend === 'up' ? ( ) : ( )} {metric.trendValue}
)}

{metric.title}

{metric.value}

{metric.subtitle}

))}
{/* Top Pages */}

{t('topPages.title')}

{topPages.map((page, index) => ( ))}
{t('topPages.columns.path')} {t('topPages.columns.views')} {t('topPages.columns.change')}
{page.path} {page.views.toLocaleString()} {page.change}
); }