import { redirect } from "next/navigation";
import { getCurrentUser } from "@/lib/auth-utils";
import GuideDashboard from "./guide-dashboard";
import ExplorerDashboard from "./explorer-dashboard";

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

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

  if (user.role === "GUIDE") {
    return <GuideDashboard user={user} />;
  }

  return <ExplorerDashboard user={user} />;
}
