import { redirect } from 'next/navigation';
import { getCurrentUser } from '@/lib/auth';
import DashboardLayout from '@/components/DashboardLayout';
import Messagerie from '@/components/Messagerie';

export default async function MessageriePage() {
  const user = await getCurrentUser();

  if (!user) {
    redirect('/login');
  }

  return (
    <DashboardLayout user={user}>
      <div className="h-full">
        <Messagerie />
      </div>
    </DashboardLayout>
  );
}
