<script lang="ts">
  import DbInput from "./DBInput.svelte";
  import Login from "./Login.svelte";
  import Books from "./Books.svelte";
  import AddBook from "./AddBook.svelte";
  let whereami = "check-db";
  // whereami = "books";
  let ebook = {};
  // whereami = "books";

  $: {
    console.log(whereami);
  }
</script>

{#if whereami === "check-db"}
  <DbInput bind:whereami />
{:else if whereami === "login"}
  <Login bind:whereami />
{:else if whereami === "books"}
  <Books bind:whereami bind:ebook />
{:else if whereami === "add-book"}
  <AddBook bind:whereami mode="add" ebook={null} />
{:else if whereami === "edit-book"}
  <AddBook bind:whereami mode="edit" bind:ebook />
{/if}

<style>
  :root {
    font-family: "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell;
  }
</style>
