<script setup>
import { onMounted } from 'vue'
import { RouterLink } from 'vue-router'
import { initDrawers } from 'flowbite'

onMounted(() => {
  initDrawers()
})
</script>

<template>
  <nav class="mx-auto max-w-screen-xl flex flex-wrap items-center justify-between">
    <!-- <div class=""> -->
    <a href="https://codex.storage/" class="flex items-center rtl:space-x-reverse">
      <img src="../assets/logo.svg" class="h-8 hidden dark:inline" alt="Codex Logo" />
      <img src="../assets/logo-black.svg" class="h-8 inline dark:hidden" alt="Codex Logo" />
      <span class="self-center ml-3 text-2xl font-semibold whitespace-nowrap dark:text-white"
        >Codex</span
      >
    </a>
    <div class="flex md:order-2 space-x-3 md:space-x-0 rtl:space-x-reverse">
      <button
        type="button"
        class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"
      >
        Instructions
      </button>
      <button
        data-collapse-toggle="navbar-sticky"
        type="button"
        class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
        aria-controls="navbar-sticky"
        aria-expanded="false"
      >
        <span class="sr-only">Open main menu</span>
        <svg
          class="w-5 h-5"
          aria-hidden="true"
          xmlns="http://www.w3.org/2000/svg"
          fill="none"
          viewBox="0 0 17 14"
        >
          <path
            stroke="currentColor"
            stroke-linecap="round"
            stroke-linejoin="round"
            stroke-width="2"
            d="M1 1h15M1 7h15M1 13h15"
          />
        </svg>
      </button>
    </div>
    <div
      class="items-center justify-between hidden w-full md:flex md:w-auto md:order-1"
      id="navbar-sticky"
    >
      <ul
        class="flex flex-col p-4 md:p-0 mt-4 font-medium border border-gray-100 rounded-lg bg-gray-50 md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700"
      >
        <li>
          <RouterLink
            class="router-link block py-2 px-3 rounded md:bg-transparent md:text-blue-700 md:p-0 md:dark:text-blue-500"
            to="/"
            >Requests</RouterLink
          >
        </li>
        <li>
          <RouterLink
            class="router-link block py-2 px-3 rounded text-gray-900 hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700"
            to="/slots"
            >Slots</RouterLink
          >
        </li>
      </ul>
    </div>
    <!-- </div> -->
  </nav>
</template>

<style scoped>
nav a.router-link-exact-active {
  @apply text-white bg-blue-700 md:bg-transparent md:text-blue-700 md:p-0 dark:text-white md:dark:text-blue-500;
}
</style>
