"use client";
import React, { useState } from 'react';
import Link from 'next/link';
import { LayoutDashboard, Edit3, ShoppingBag, CreditCard, LogOut, Eye } from 'lucide-react';
import { useRouter } from 'next/navigation';
import { User } from '../../types';
import { MOCK_BUSINESSES } from '../../lib/mockData';
import DashboardOverview from '../../components/dashboard/DashboardOverview';
import DashboardProfile from '../../components/dashboard/DashboardProfile';
import DashboardOffers from '../../components/dashboard/DashboardOffers';
import PricingSection from '../../components/PricingSection';
import { useUser } from '../../components/UserProvider';
const DashboardPage = () => {
const { user, logout } = useUser();
const router = useRouter();
const [currentView, setCurrentView] = useState<'overview' | 'profile' | 'offers' | 'subscription'>('overview');
const [business, setBusiness] = useState(MOCK_BUSINESSES[0]); // In real app, fetch by user.id
if (!user) {
if (typeof window !== 'undefined') router.push('/login');
return null;
}
return (
{/* 1. Sidebar */}
{/* 2. Main Content */}
{currentView === 'overview' && 'Vue d\'ensemble'}
{currentView === 'profile' && 'Mon Profil'}
{currentView === 'offers' && 'Gestion des Offres'}
{currentView === 'subscription' && 'Mon Abonnement'}
{currentView === 'overview' &&
}
{currentView === 'profile' &&
}
{currentView === 'offers' &&
}
{currentView === 'subscription' && (
Abonnement Actuel : Starter (Gratuit)
Passez au niveau supérieur pour débloquer plus de fonctionnalités.
Actif
)}
);
}
export default DashboardPage;