import { Suspense } from 'react';
import ChatServer from './server';
import Loading from '@/components/ui/Loading';
import { auth } from '@/auth';

interface PageProps {
  params: {
    id: string;
  };
}

export default async function Page({ params }: PageProps) {
  const { id: chatId } = params;
  return (
    <Suspense
      fallback={
        <div className="h-screen w-screen flex justify-center items-center">
          <Loading />
        </div>
      }
    >
      <ChatServer chatId={chatId} />
    </Suspense>
  );
}
