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

export const dynamic = "force-dynamic";

export default async function MachinesPage() {
  const session = await auth();
  if (!session?.user) redirect("/login");
  if (session.user.role === "CLIENT") redirect("/dashboard");
  return <MachinesClient />;
}
