import Image from "next/image";
import {Metadata} from "next";
import Link from "next/link";
import {getSession} from "@auth0/nextjs-auth0";
import {redirect} from "next/navigation";

export const metadata: Metadata = {
    title: "IBD Trader",
}

export default async function Home() {
    const user = await getSession();

    if (user) {
        redirect("/dashboard")
    }

    return (
        <div className="min-h-screen flex flex-col items-center justify-center bg-gray-100">
            <main className="flex flex-col items-center justify-center w-full flex-1 px-20 text-center">
                <div className="flex justify-center">
                    <Image src="/logo.svg" alt="IBD Trader" width={200} height={200}/>
                </div>
                <h1 className="text-6xl font-bold mt-4">Trader</h1>
                <button className="mt-16 px-6 py-3 bg-blue-500 text-white rounded-md hover:bg-blue-600">
                    <Link href="/api/auth/login">
                        Login
                    </Link>
                </button>
            </main>
        </div>
    );
}
