41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { redirect } from 'next/navigation';
|
|
import { getSession } from '@/lib/session';
|
|
import { DashboardHeader } from '@/components/dashboard/dashboard-header';
|
|
import { EnhancedBookingCalendar } from '@/components/booking/enhanced-booking-calendar';
|
|
import { UserBookingManagement } from '@/components/booking/user-booking-management';
|
|
|
|
export default async function DashboardPage() {
|
|
const session = await getSession();
|
|
|
|
if (!session) {
|
|
redirect('/login');
|
|
}
|
|
|
|
return (
|
|
<div className='min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100'>
|
|
<DashboardHeader user={session} />
|
|
|
|
<main className='container mx-auto px-4 py-8'>
|
|
<div className='grid gap-8 lg:grid-cols-3'>
|
|
{/* Main Content */}
|
|
<div className='lg:col-span-2 space-y-6'>
|
|
<div>
|
|
<h1 className='text-3xl font-bold text-gray-900 mb-2'>
|
|
Welcome back, {session.email.split('@')[0]}! 🏓
|
|
</h1>
|
|
<p className='text-gray-600'>Book your table tennis court and enjoy your game</p>
|
|
</div>
|
|
|
|
<EnhancedBookingCalendar />
|
|
</div>
|
|
|
|
{/* Sidebar */}
|
|
<div className='space-y-6'>
|
|
<UserBookingManagement />
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
);
|
|
}
|