import { redirect } from "next/navigation";

import { auth } from "@/auth";
import { getBoard } from "@/lib/board";
import { KanbanBoard } from "@/components/board/kanban-board";

export default async function HomePage() {
  const session = await auth();
  if (!session?.user) redirect("/login");

  const board = await getBoard({ userId: session.user.id, projectId: null });

  return <KanbanBoard initialCategories={board} />;
}
