import { notFound } from 'next/navigation'; import Link from 'next/link'; import { auth } from '@/lib/auth'; import { getWorkshop, getSessionsTabUrl } from '@/lib/workshops'; import { getMotivatorSessionById } from '@/services/moving-motivators'; import { getUserTeams } from '@/services/teams'; import type { ResolvedCollaborator } from '@/services/auth'; import { MotivatorBoard, MotivatorLiveWrapper } from '@/components/moving-motivators'; import { Badge, CollaboratorDisplay } from '@/components/ui'; import { EditableMotivatorTitle } from '@/components/ui'; interface MotivatorSessionPageProps { params: Promise<{ id: string }>; } export default async function MotivatorSessionPage({ params }: MotivatorSessionPageProps) { const { id } = await params; const authSession = await auth(); if (!authSession?.user?.id) { return null; } const [session, userTeams] = await Promise.all([ getMotivatorSessionById(id, authSession.user.id), getUserTeams(authSession.user.id), ]); if (!session) { notFound(); } return (
{/* Header */}
{getWorkshop('motivators').label} / {session.title} {!session.isOwner && ( Partagé par {session.user.name || session.user.email} )}
{session.cards.filter((c) => c.influence !== 0).length} / 10 évalués {new Date(session.date).toLocaleDateString('fr-FR', { day: 'numeric', month: 'long', year: 'numeric', })}
{/* Live Wrapper + Board */}
); }