import { Outlet } from "react-router";

import { redirectAuthenticated } from "@/lib/auth.server";

import type { Route } from "./+types/layout";

export const loader = ({ request }: Route.LoaderArgs) =>
  redirectAuthenticated(request);

export default function AuthLayout() {
  return (
    <main className="grid min-h-svh place-items-center bg-muted/30 p-6 md:p-10">
      <div className="w-full max-w-sm">
        <Outlet />
      </div>
    </main>
  );
}
