import html from 'choo/html'; import { LoginController } from './controller'; export const loginView = (state, emit, i18n) => { const controller = new LoginController(state, emit, i18n); const { __ } = controller.i18n; if (controller.appState.isLoggedIn === true) { setTimeout(() => { controller.state.loginMessage = ''; emit('pushState', '/') }, 3000); return html``; } return html`
${ controller.state.pageMessage === '' ? null : html`
${controller.state.pageMessage}
` }

${__('login.log_in')}

${ controller.state.loginError === '' ? null : html`
${controller.state.loginError}
` }

${__('login.create_account')}

`; }