diff --git a/src/components/auth/DashboardContent.tsx b/src/components/auth/DashboardContent.tsx index 7fba7d3..214f721 100644 --- a/src/components/auth/DashboardContent.tsx +++ b/src/components/auth/DashboardContent.tsx @@ -1,11 +1,9 @@ 'use client'; -import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; -import { Loader2, BarChart2, Users, Eye, Clock, TrendingUp, TrendingDown, LogOut } from 'lucide-react'; +import { BarChart2, Users, Eye, Clock, TrendingUp, TrendingDown, LogOut } from 'lucide-react'; import { useTranslations, useLocale } from 'next-intl'; import { createClient } from '@/lib/supabase/client'; -import type { User } from '@supabase/supabase-js'; interface MetricCard { title: string; @@ -20,25 +18,6 @@ export default function DashboardContent() { const t = useTranslations('dashboard'); const locale = useLocale(); const router = useRouter(); - const [user, setUser] = useState(null); - const [loading, setLoading] = useState(true); - - useEffect(() => { - const checkAuth = async () => { - const supabase = createClient(); - const { data: { user } } = await supabase.auth.getUser(); - - if (!user) { - router.push(`/${locale}/login`); - return; - } - - setUser(user); - setLoading(false); - }; - - checkAuth(); - }, [locale, router]); const handleLogout = async () => { const supabase = createClient(); @@ -46,25 +25,6 @@ export default function DashboardContent() { router.push(`/${locale}`); }; - if (loading) { - return ( -
-
- -

{t('status.loading')}

-
-
- ); - } - - if (!user) { - return ( -
-

{t('status.notAuthenticated')}

-
- ); - } - const metrics: MetricCard[] = [ { title: t('metrics.pageViews.title'),