import React from 'react'
import { useStore } from '@nanostores/react'
import { LandingPage } from './components/LandingPage'
import { VNInterface } from './components/VNInterface'
import { isLoggedInStore, login, logout } from './stores'

export default function App() {
  const isLoggedIn = useStore(isLoggedInStore)

  return (
    <>
      {isLoggedIn ? (
        <VNInterface onLogout={logout} />
      ) : (
        <LandingPage onLogin={login} />
      )}
    </>
  )
}
