'use client';

import {useEffect} from "react";
import {signIn} from "next-auth/react";
import {Loader2} from "lucide-react"; // optional loading spinner
import {cn} from "@/lib/utils"; // optional: your className utility

export default function LoginScreen() {
    useEffect(() => {
        // Immediately redirect to Keycloak
        signIn("keycloak");
    }, []);

    return (
        <div className="flex min-h-screen items-center justify-center bg-muted">
            <div className="flex flex-col items-center gap-2 text-center">
                <Loader2 className={cn("h-6 w-6 animate-spin text-muted-foreground")}/>
                <p className="text-sm text-muted-foreground">Leite zur Anmeldung weiter ...</p>
            </div>
        </div>
    );
}
