<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: () => {
      // eslint-disable-next-line @typescript-eslint/no-empty-function
      return () => {};
    },
    navigate: (to: string | number) => {
      dispatch("navigate", to);
    },
  };
</script>

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