<script>
import Scanner from "./Scanner.svelte";
import Login from "./Login.svelte";
import Settings from "./Settings.svelte";
import { apikey, lang, page } from "./store.js";
$: is_configured = $apikey && $apikey !== "null" && $apikey !== "";
$: settings_open = $page === "settings";
console.log($page);
</script>

{#if settings_open && is_configured}
<Settings />
{:else if is_configured}
<Scanner />
{:else}
<Login />
{/if}
