<script lang="ts">
  import { auth } from '$lib/stores/auth.svelte';
</script>

<h1>Mode Template</h1>

{#if auth.loading}
  <p>Loading...</p>
{:else if auth.isAuthenticated}
  <p>Welcome, {auth.user?.displayName}!</p>
  <p>Email: {auth.user?.email}</p>
{:else}
  <p>Please log in to continue.</p>
  <button onclick={() => auth.redirectToLogin()}>
    Sign in with Microsoft
  </button>
{/if}
