<script>
  import { addMessages, init, getLocaleFromNavigator } from "svelte-i18n";
  import en from "./locales/en";
  import de from "./locales/de";
  addMessages("en", en);
  addMessages("de", de);
  init({
    fallbackLocale: "en",
    initialLocale: getLocaleFromNavigator(),
  });
  //
  import Login from "./components/Login.svelte";
  import Dashboard from "./components/Dashboard.svelte";
  import store from "./store.js";
  store.init();
  $: logged_in = $store.isLoggedIn;
</script>

{#if logged_in === true}
  <Dashboard />
{:else}
  <Login />
{/if}
