ubicloud/views/components/tabbar.erb
Jeremy Evans 750ebdc055 Change from erb_formatter to herb/formatter
Currently, herb/formatter has at least 4 bugs the prevent us from
switching to it (https://github.com/marcoroth/herb/issues 476, 477,
478, and 479). This includes manual fixes for each issue.

herb/formatter also introduces a rubocop violation for the
Layout/AssignmentIndentation cop. This disables that cop.
2025-09-05 14:01:01 -07:00

22 lines
923 B
Text

<%# locals: (tabs:) %>
<div class="sm:block mb-6">
<nav
class="isolate flex divide-x divide-gray-200 rounded-lg shadow"
aria-label="Tabs"
>
<% tabs.each_with_index do |(label, url, active), i| %>
<% active = (request.path == url) if active.nil? %>
<a
href="<%= url %>"
class="group flex items-center justify-center relative min-w-0 flex-1 overflow-hidden <%= (i == 0) ? "rounded-l-lg" : ((i == tabs.size - 1) ? "rounded-r-lg" : "") %> px-4 py-4 text-center text-sm bg-white font-medium focus:z-10 <%= active ? "text-orange-600 hover:text-orange-700 hover:bg-orange-50" : "text-gray-500 hover:text-orange-500 hover:bg-orange-50" %>"
>
<span><%= label %></span>
<span
aria-hidden="true"
class="absolute inset-x-0 bottom-0 h-0.5 <%= active ? "bg-orange-600" : "bg-transparent" %>"
></span>
</a>
<% end %>
</nav>
</div>