<script>
  import { page } from "$lib/stores/page.svelte.js";
  import DictationPage from "$lib/pages/DictationPage.svelte";
  import FilesPage from "$lib/pages/FilesPage.svelte";
  import TasksPage from "$lib/pages/TasksPage.svelte";
  import HistoryPage from "$lib/pages/HistoryPage.svelte";
  import SettingsPage from "$lib/pages/SettingsPage.svelte";
  import FirstRunPage from "$lib/pages/FirstRunPage.svelte";

  // Redirect legacy "profiles" page to settings
  $effect(() => {
    if (page.current === "profiles") page.current = "settings";
  });
</script>

<main class="h-full overflow-hidden" aria-label="Kon application content">
  {#if page.current === "first-run"}
    <FirstRunPage />
  {:else if page.current === "dictation"}
    <DictationPage />
  {:else if page.current === "files"}
    <FilesPage />
  {:else if page.current === "tasks"}
    <TasksPage />
  {:else if page.current === "history"}
    <HistoryPage />
  {:else if page.current === "settings"}
    <SettingsPage />
  {/if}
</main>
