<header class="container-fluid bg-light border-bottom py-3 sticky-top">
  <div class="row align-items-center">
    <div class="col-4">
      <%= link_to signed_in_root_path, class: "navbar-brand" do %>
        <%= suite_wordmark %>
      <% end %>
      <%= link_to fa_icon("arrow-circle-left", text: "Back To Account"), :projects, class: "text-reset text-decoration-none" %>
    </div>
    <div class="col-4 text-center">
      <h1 class="h4 m-0">Admin</h1>
    </div>
    <div class="col-4 text-right">
      <div class="btn-group">
        <%= link_to :profile, class: "text-decoration-none text-reset dropdown-toggle", data: { toggle: "dropdown" } do %>
          <span class="mr-2"><%= get_name_or_email(Current.user) %></span>
          <%= image_or_text_avatar(Current.user) %>
        <% end %>

        <div class="dropdown-menu">
          <% if Current.user.admin? %>
            <%= link_to "BIG Admin", [:admin, :signed_in_root], class: "dropdown-item" %>
          <% end %>

          <%= link_to "Profile Settings", profile_path, class: "dropdown-item" %>

          <% # TODO: Use null object pattern %>
          <% if Current.account && Current.user.account_manager?(Current.account) %>
            <%= link_to "Account Settings", [:account_auths], class: "dropdown-item" %>
          <% end %>

          <%= link_to t(".sign_out"), :session, method: :delete, class: "dropdown-item" %>
        </div>
      </div>
    </div>
  </div>
</header>
