"use client"; /** * Facebook 面板(默认登录面板) * * 原始 Dart: lib/ui/auth/widgets/auth_facebook_panel.dart * * 视觉规格(与 Dart 对齐): * - Spacer → logo(120h)→ Spacer → Facebook 主按钮 → 链接 → Spacer → 法律 * - Facebook 主按钮:46px 白胶囊 + Facebook "f" 图标(#1877f2)+ "Login with Facebook" * - 社交登录统一收口到 Auth 状态机:派发 `AuthFacebookLoginSubmitted` / * `AuthGoogleLoginSubmitted` 事件,状态机内部调 next-auth/react 的 signIn(provider) * - busy / error 状态来自 `useAuthState()`(与邮箱登录同源) * - "Other Sign-in Options" 链接打开底部弹层 * - 弹层 Email 按钮 → 触发 `onSwitchToEmail`(父级派发 `AuthPanelModeChanged`) */ import Image from "next/image"; import { useState } from "react"; import { useAuthDispatch, useAuthState } from "@/stores/auth/auth-context"; import { AuthErrorMessage } from "./auth-error-message"; import { AuthLegalText } from "./auth-legal-text"; import { AuthOtherOptionsDialog } from "./auth-other-options-dialog"; import styles from "./auth-facebook-panel.module.css"; export interface AuthFacebookPanelProps { onSwitchToEmail: () => void; } export function AuthFacebookPanel({ onSwitchToEmail }: AuthFacebookPanelProps) { const [showOptions, setShowOptions] = useState(false); const { isLoading, errorMessage } = useAuthState(); const authDispatch = useAuthDispatch(); const handleFacebook = () => { authDispatch({ type: "AuthFacebookLoginSubmitted", provider: "facebook", }); }; const handleGoogle = () => { authDispatch({ type: "AuthGoogleLoginSubmitted", provider: "google", }); }; return (