import { auth } from "@/auth";
import { redirect } from "next/navigation";
import { ExportDetailClient } from "./ExportDetailClient";

export const dynamic = "force-dynamic";

export default async function ExportDetailPage({
  params,
}: {
  params: Promise<{ exportId: string }>;
}) {
  const session = await auth();
  if (!session?.user) redirect("/login");
  if (session.user.role === "CLIENT") redirect("/dashboard");
  const { exportId } = await params;
  return <ExportDetailClient exportId={exportId} />;
}
