<script>
  import Layout from './lib/layout/Layout.svelte';
  import WorldMap from './lib/world-map/WorldMap.svelte';
  import StatsPanel from './lib/world-map/StatsPanel.svelte';
  import TimelineView from './lib/TimelineView.svelte';

  let screen = $state('worldmap');

  function onNavigate(s) {
    screen = s;
  }
</script>

<Layout {screen} {onNavigate}>
  {#if screen === 'worldmap'}
    <div class="worldmap-page">
      <div class="map-area">
        <WorldMap />
      </div>
      <StatsPanel />
    </div>
  {:else}
    <TimelineView />
  {/if}
</Layout>

<style>
  .worldmap-page {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
  }

  .map-area {
    flex: 1;
    overflow: hidden;
  }
</style>
