import AuthScreen from "@/components/Login2";
import ProfileScreen from "@/components/Profile";
import { Link } from "waku";
import db from "@/lib/db";
import { getContextData } from "waku/middleware/context";

export default async function AuthPage() {
  const ctx = getContextData();
  console.log({ ctx });
  const data = await getData();
  if (ctx.user) return <ProfileScreen user={ctx.user as any} />;
  else
    return (
      <div>
        <AuthScreen />
      </div>
    );
}

const getData = async () => {
  // const data = {
  //   title: "Waku",
  //   headline: "Waku",
  //   body: "Hello world!",
  // };
  // return data;
};

export const getConfig = async () => {
  return {
    render: "static",
  } as const;
};
