import { AppState } from '@/ui_models/app_state'; import { useState } from 'preact/hooks'; import { WebApplication } from '@/ui_models/application'; import { observer } from 'mobx-react-lite'; type Props = { application: WebApplication; appState: AppState; } const Footer = observer(({ application, appState, }: Props) => { const { showLogin, showRegister, setShowLogin, setShowRegister, setSigningOut } = appState.accountMenu; const user = application.getUser(); const { showBetaWarning, disableBetaWarning: disableAppStateBetaWarning } = appState; const [appVersion] = useState(() => `v${((window as any).electronAppVersion || application.bridge.appVersion)}`); const disableBetaWarning = () => { disableAppStateBetaWarning(); }; const signOut = () => { setSigningOut(true); }; const hidePasswordForm = () => { setShowLogin(false); setShowRegister(false); }; return (
{appVersion} {showBetaWarning && ( ( Hide beta warning ) )}
{(showLogin || showRegister) && ( Cancel )} {!showLogin && !showRegister && ( {user ? 'Sign out' : 'Clear session data'} )}
); }); export default Footer;