import { html, render } from 'lit-html'; import pkg from './../package.json'; import { signOut } from './components/databiz.login'; const root :HTMLElement = document.querySelector('#root'); console.log(process.env.CLIENT_ID); interface State { empty: boolean, data: object }; const state :State = { data: undefined, empty: true }; const display = (evt :CustomEvent) => { state.data = evt.detail; state.empty = false; render(markup(state), root); } const logout = (evt :CustomEvent) => { signOut().then(() => { state.data = undefined; state.empty = true; render(markup(state), root); }); } const result = (state :State) => state.empty ? '' : html`
${JSON.stringify(state.data, null, 2)}
`; const markup = (state :State) => html`

${pkg.name}

Test it now!

display(e)} @signin-error=${(e :CustomEvent) => display(e)} client-id=${process.env.CLIENT_ID} >
${result(state)}
`; render(markup(state), root);