ubicloud/views/components/breadcrumb.erb
Enes Cakir 9d5cf249ea Move icons to separate file
There are several ways to show SVG in HTML. One of the recommended way is
showing SVG inline. We are doing it. But long SVG paths make hard to
maintain HTML files. Also some of the icons used multiple times.

I created an icon component and show icon depending on its name. So all
of the our SVG icons go to "icon.erb" file.

I excluded this file from erb_formatter because it couldn't format `when`
cases correctly.
2023-08-04 10:35:00 +03:00

29 lines
1.1 KiB
Text

<div>
<nav class="sm:hidden" aria-label="Back">
<a href="<%= back %>" class="flex items-center text-sm font-medium text-gray-500 hover:text-gray-700">
<div class="-ml-1 mr-1 flex-shrink-0 text-gray-400">
<%== render("components/icon", locals: { name: "hero-chevron-left", classes: "w-5 h-5" }) %>
</div>
Back
</a>
</nav>
<nav class="hidden sm:flex" aria-label="Breadcrumb">
<ol role="list" class="flex items-center space-x-4">
<% parts.take(1).each do |name, url| %>
<li>
<div class="flex">
<a href="<%= url %>" class="text-sm font-medium text-gray-500 hover:text-gray-700"><%= name %></a>
</div>
</li>
<% end %>
<% parts.drop(1).each do |name, url| %>
<li>
<div class="flex items-center">
<%== render("components/icon", locals: { name: "hero-chevron-right", classes: "w-5 h-5 flex-shrink-0 text-gray-400" }) %>
<a href="<%= url %>" class="ml-4 text-sm font-medium text-gray-500 hover:text-gray-700"><%= name %></a>
</div>
</li>
<% end %>
</ol>
</nav>
</div>