import { Loader2, Sparkles } from 'lucide-react'; import { PlatformActionButton } from '../../common/PlatformActionButton'; import { PlatformStatusMessage } from '../../common/PlatformStatusMessage'; import { PlatformTextField } from '../../common/PlatformTextField'; import { UnifiedModal } from '../../common/UnifiedModal'; export type PuzzleOnboardingPhase = 'input' | 'generating' | 'generated'; type PuzzleOnboardingViewProps = { prompt: string; phase: PuzzleOnboardingPhase; error: string | null; copy: string; onPromptChange: (value: string) => void; onSubmit: () => void; onSkip: () => void; }; export function PuzzleOnboardingView({ prompt, phase, error, copy, onPromptChange, onSubmit, onSkip, }: PuzzleOnboardingViewProps) { const isGenerating = phase === 'generating'; const isGenerated = phase === 'generated'; const canSubmit = Boolean(prompt.trim()) && !isGenerating && !isGenerated; return (
跳过
{isGenerating ? ( ) : ( )}

{copy}

{ event.preventDefault(); onSubmit(); }} > onPromptChange(event.target.value)} placeholder="把你的梦讲给我听吧" rows={4} className="min-h-32 rounded-[1.25rem] border-white/14 bg-black/28 py-4 leading-7 shadow-[0_18px_50px_rgba(0,0,0,0.24)] backdrop-blur placeholder:text-white/42 focus:border-amber-200/70 focus:ring-2 focus:ring-amber-200/20 disabled:opacity-70" /> {isGenerating ? ( <> 生成 ) : ( '生成' )} {error ? ( {error} ) : null}
); } type PuzzleOnboardingLoginOverlayProps = { isSaving: boolean; error: string | null; copy: string; onLogin: () => void; }; export function PuzzleOnboardingLoginOverlay({ isSaving, error, copy, onLogin, }: PuzzleOnboardingLoginOverlayProps) { return ( undefined} portal={false} showHeader={false} showCloseButton={false} closeOnBackdrop={false} closeOnEscape={false} size="sm" zIndexClassName="z-[110]" overlayClassName="!items-center bg-slate-950/72 !px-4 !py-6 text-white backdrop-blur-md" panelClassName="!max-w-[24rem] !rounded-[1.35rem] border border-white/14 bg-slate-950/94 text-white shadow-[0_28px_90px_rgba(0,0,0,0.5)]" bodyClassName="flex flex-col items-center gap-5 !px-5 !py-6 text-center" >
{isSaving ? ( ) : ( )}

{copy}

{isSaving ? ( <> 注册账号 / 登录 ) : ( '注册账号 / 登录' )} {error ? ( {error} ) : null}
); }