import { json, Link, LoaderFunction, useLoaderData } from "remix";
import { getUser, getSession } from "~/session.server";
import { useOptionalUser } from "~/utils";

export const loader: LoaderFunction = async ({ request }) => {
  const user_info = await getUser(request);
  return json(user_info);
}

export default function Index() {
  const discordUser = useLoaderData();
  console.log("discordUser is", discordUser);
  return (
    <main className="relative min-h-screen bg-white sm:flex sm:items-center sm:justify-center">
      <h1>Do you love the color of the sky?</h1>
      <br />
      <Link
      to="/loginstart">
      Log in
      </Link>
    </main>
  );
}
