<script lang="ts">
  import { sessionManager } from '../../services/auth/session-manager.js';
</script>

<header class="bg-board-post border-b border-board-border p-4">
  <nav class="flex items-center justify-between">
    <a href="/" class="text-xl font-bold">Aitherboard</a>
    <div class="flex gap-4">
      {#if $sessionManager.isLoggedIn()}
        <span>Logged in as: {$sessionManager.getCurrentPubkey()?.slice(0, 16)}...</span>
        <button on:click={() => sessionManager.clearSession()}>Logout</button>
      {:else}
        <a href="/login">Login</a>
      {/if}
      <a href="/feed">Feed</a>
      <a href="/threads">Threads</a>
    </div>
  </nav>
</header>

<style>
  header {
    max-width: 100%;
  }
</style>
