<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="csrf-token" content={get_csrf_token()} />
    <.live_title suffix=" · Phoenix Framework">
      <%= assigns[:page_title] || "Derivantes" %>
    </.live_title>
    <link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
    <script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
    </script>
    <script src="https://kit.fontawesome.com/8afa33c96d.js" crossorigin="anonymous"></script>
  </head>
  <body class="gray antialiased">
    <ul>
      <%= if @current_user do %>
        <div class="nav-bar-study">
          <img src={~p"/images/sana_americano_logo.png"} alt="IM LOGO"/>
          <div style="display: flex; align-items: center;">
            <i class="fa-solid fa-user" style="color: white;"></i>
            <li class="text-m leading-6 text-white">
              <%= @current_user.email %>
            </li>
            <li>
              <.link
                href={~p"/derivantes/log_out"}
                method="delete"
                class="text-m leading-6 text-white hover:text-gray font-semibold"
              >
                Salir
              </.link>            
            </li>
          </div>
        </div>
      <% else %>
        <div class="nav-bar-study">
          <img src={~p"/images/sana_americano_logo.png"} alt="Sanatorio Americano Logo"/>
          <div style="display: flex; flex-direction: row;">
            <li>          
              <.link
                href={~p"/derivantes/register"}
                class="text-m leading-6 text-white hover:text-gray"
              >
                Registrarse
              </.link>
            </li>
            <li>
              <.link
                href={~p"/derivantes/log_in"}
                class="text-m leading-6 text-white hover:text-gray"
              >
                Ingresar
              </.link>
            </li>
          </div>
        </div>
      <% end %>
    </ul>
    <%= @inner_content %>
  </body>
</html>
