import { notFound } from 'next/navigation'; import Link from 'next/link'; import { auth } from '@/lib/auth'; import { getWeatherSessionById } from '@/services/weather'; import { getUserTeams } from '@/services/teams'; import { WeatherBoard, WeatherLiveWrapper, WeatherInfoPanel } from '@/components/weather'; import { Badge } from '@/components/ui'; import { EditableWeatherTitle } from '@/components/ui/EditableWeatherTitle'; interface WeatherSessionPageProps { params: Promise<{ id: string }>; } export default async function WeatherSessionPage({ params }: WeatherSessionPageProps) { const { id } = await params; const authSession = await auth(); if (!authSession?.user?.id) { return null; } const [session, userTeams] = await Promise.all([ getWeatherSessionById(id, authSession.user.id), getUserTeams(authSession.user.id), ]); if (!session) { notFound(); } return (
{/* Header */}
Météo / {session.title} {!session.isOwner && ( Partagé par {session.user.name || session.user.email} )}
{session.entries.length} membres {new Date(session.date).toLocaleDateString('fr-FR', { day: 'numeric', month: 'long', year: 'numeric', })}
{/* Info sur les catégories */} {/* Live Wrapper + Board */}
); }