<div class="user-info <%= current_user == user ? "current-user" : "" %>">
  <%= image_tag user.icon_url,
                size: "32x32",
                class: "avatar",
                alt: "#{user.username}'s avatar" if user.icon_url %>
  <% if local_assigns.fetch(:show, []).include?(:slack) && user.slack_uid.present? %>
    <%= link_to "@#{user.username}", "https://slack.com/app_redirect?channel=#{user.slack_uid}", target: "_blank" %>
  <% else %>
    <%= user.username %>
  <% end %>
  <% unless current_user == user %>
    <% admin_tool(element: 'span') do %>
      <%= link_to impersonate_user_path(user), class: "impersonate-link" do %>
        <%= vite_image_tag 'images/icons/impersonate.png', id: "treasure", width: '16px', height: '16px' %>
    <% end %>
    <% end %>
  <% end %>
</div>