<%= lucide_icon "alert-triangle", class: "w-6 h-6 text-white mr-2" %> Super Admin
<%= link_to "Jobs", good_job_url, class: "text-white underline hover:text-gray-100" %>
<% if Current.session.active_impersonator_session.present? %>
Impersonating: <%= Current.impersonated_user.email %>
<%= button_to "Leave", leave_impersonation_sessions_path, method: :delete, class: "items-center px-3 py-1.5 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %> <%= button_to "Terminate", complete_impersonation_session_path(Current.session.active_impersonator_session), method: :put, class: "items-center px-3 py-1.5 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %>
<% else %> <% if Current.true_user.impersonator_support_sessions.in_progress.any? %> <%= form_with url: join_impersonation_sessions_path, class: "flex items-center space-x-2 mr-4" do |f| %> <%= f.select :impersonation_session_id, Current.true_user.impersonator_support_sessions.in_progress.map { |session| ["#{session.impersonated.email} (#{session.status})", session.id] }, { prompt: "Join a session" }, { class: "rounded-md text-sm border-0 focus:ring-0 ring-0 text-black font-mono" } %> <%= f.submit "Join", class: "inline-flex items-center px-3 py-1.5 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %> <% end %> <% end %> <%= form_with model: ImpersonationSession.new, class: "flex items-center space-x-2" do |f| %> <%= f.text_field :impersonated_id, class: "rounded-md text-sm border-0 focus:ring-0 ring-0 text-black font-mono w-96", placeholder: "UUID", autocomplete: "off" %> <%= f.submit "Request Impersonation", class: "inline-flex items-center px-3 py-1.5 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" %> <% end %> <% end %>