import { signIn, useSession } from "next-auth/react" import { useState, useEffect } from "react" import { useNDKContext } from "@/context/NDKContext"; import { Button } from 'primereact/button'; import { InputText } from 'primereact/inputtext'; export default function SignIn() { const [email, setEmail] = useState("") const [showEmailInput, setShowEmailInput] = useState(false) const [nostrPubkey, setNostrPubkey] = useState("") const [nostrPrivkey, setNostrPrivkey] = useState("") const {ndk, addSigner} = useNDKContext(); const { data: session, status } = useSession(); // Get the current session's data and status useEffect(() => { console.log("session", session) }, [session]) const handleEmailSignIn = async (e) => { e.preventDefault() await signIn("email", { email, callbackUrl: '/' }) } const handleNostrSignIn = async (e) => { e.preventDefault() if (!ndk.signer) { await addSigner(); } try { const user = await ndk.signer.user() const pubkey = user?._pubkey signIn("nostr", { pubkey }) } catch (error) { console.error("Error signing Nostr event:", error) } } const handleAnonymousSignIn = (e) => { e.preventDefault() signIn("anonymous") } return (