<script lang="ts">
  import { Router } from "svelte-navigator";
  import type { NavigatorHistory } from "svelte-navigator";
  import { createEventDispatcher } from "svelte";
  const dispatch = createEventDispatcher();

  const nullHistory: NavigatorHistory = {
    location: {
      _key: "",
      state: {},
      pathname: "",
      search: "",
      hash: "",
    },
    listen: () => {
      return () => {};
    },
    navigate: (to: string | number) => {
      dispatch("navigate", to);
    },
  };
</script>

<Router history={nullHistory} primary={false}>
  <slot />
</Router>
