<template>
  <div class="flex items-center border-b border-b-gray-700 bg-neutral-800 px-5">
    <h1 class="text-2xl font-bold text-primary">Polarcraft</h1>
    <Button outline class="ml-auto" @click="logout">Logout</Button>
  </div>
</template>

<script setup>
const logout = async () => {
  try {
    await useFetch('/api/auth/logout')

    navigateTo('/login')
  } catch (err) {
    console.log(err)
    alert(err.statusMessage)
  }
}
</script>
