import React from 'react' import LoginDialog from '../LoginDialog' import UserSelectionDialog, { type UserInfo as SelectedUserInfo } from '../UserSelectionDialog' interface CurrentUser { username: string userType: 'Admin' | 'User' } interface UnauthenticatedAppProps { isAuthenticating: boolean showLoginDialog: boolean showUserSelection: boolean computerName: string currentUser: CurrentUser | null allUsers: SelectedUserInfo[] errorMessage: string onLogin: (username: string, password: string) => Promise onLoginCancel: () => void onSelectUser: (user: SelectedUserInfo) => Promise onUserSelectionCancel: () => void onError: (message: string) => void logoutButtonRef: React.RefObject } export function UnauthenticatedApp({ isAuthenticating, showLoginDialog, showUserSelection, computerName, currentUser, allUsers, errorMessage, onLogin, onLoginCancel, onSelectUser, onUserSelectionCancel, onError, logoutButtonRef }: UnauthenticatedAppProps): React.JSX.Element { if (isAuthenticating) { return (

认证中...

) } return ( <> {errorMessage &&
{errorMessage}
} {!showLoginDialog && !showUserSelection && (

欢迎,{currentUser?.username}!

正在加载主界面...

)} ) }