/** * OAuth placeholder component for PodTUI * Displays OAuth limitations and alternative authentication methods */ import { createSignal } from "solid-js" import { OAUTH_PROVIDERS, OAUTH_LIMITATION_MESSAGE } from "../config/auth" interface OAuthPlaceholderProps { focused?: boolean onBack?: () => void onNavigateToCode?: () => void } type FocusField = "code" | "back" export function OAuthPlaceholder(props: OAuthPlaceholderProps) { const [focusField, setFocusField] = createSignal("code") const fields: FocusField[] = ["code", "back"] const handleKeyPress = (key: { name: string; shift?: boolean }) => { if (key.name === "tab") { const currentIndex = fields.indexOf(focusField()) const nextIndex = key.shift ? (currentIndex - 1 + fields.length) % fields.length : (currentIndex + 1) % fields.length setFocusField(fields[nextIndex]) } else if (key.name === "return" || key.name === "enter") { if (focusField() === "code" && props.onNavigateToCode) { props.onNavigateToCode() } else if (focusField() === "back" && props.onBack) { props.onBack() } } else if (key.name === "escape" && props.onBack) { props.onBack() } } return ( OAuth Authentication {/* OAuth providers list */} Available OAuth Providers: {OAUTH_PROVIDERS.map((provider) => ( {provider.enabled ? "[+]" : "[-]"} {provider.name} - {provider.description} ))} {/* Limitation message */} Terminal Limitations {OAUTH_LIMITATION_MESSAGE.split("\n").map((line) => ( {line} ))} {/* Alternative options */} Recommended Alternatives: [1] Use a sync code from the web portal [2] Use email/password authentication [3] Use file-based sync (no account needed) {/* Action buttons */} [C] Enter Sync Code [Esc] Back to Login Tab to navigate, Enter to select, Esc to go back ) }