'use client'; import { signIn } from 'next-auth/react'; import { useCallback, useState, type ReactNode } from 'react'; import { CloudflareTurnstile } from '@/components/security/CloudflareTurnstile'; const TURNSTILE_SITE_KEY = process.env.NEXT_PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY; export interface PortalSignInCardProps { badge?: string; title: string; subtitle: string; callbackUrl?: string; /** Extra hint under the sign-in button (e.g. dev IdP note) */ footer?: ReactNode; } export function PortalSignInCard({ badge = 'Sankofa Phoenix', title, subtitle, callbackUrl = '/', footer, }: PortalSignInCardProps) { const [turnstileToken, setTurnstileToken] = useState(() => TURNSTILE_SITE_KEY ? null : '' ); const onTurnstileToken = useCallback((token: string | null) => { setTurnstileToken(token); }, []); const canSignIn = !TURNSTILE_SITE_KEY || Boolean(turnstileToken); return (

{badge}

{title}

{subtitle}

{TURNSTILE_SITE_KEY ? (

Verification

) : null} {footer}
); }