cannery/lib/cannery_web/live/tag_live/index.html.heex
shibao 3dd624d6de
Some checks reported errors
continuous-integration/drone/push Build was killed
style app, use components for cards
2022-02-05 01:59:40 -05:00

40 lines
1.0 KiB
Plaintext

<div class="flex flex-col space-y-8 justify-center items-center">
<h1 class="title text-2xl title-primary-500">
Listing Tags
</h1>
<p class="title text-md text-primary-500">
Tags can be added to your containers to help you organize
</p>
<%= if @tags |> Enum.empty?() do %>
<h2 class="title text-xl text-primary-500">
No tags 😔
</h2>
<%= live_patch("Make your first tag!",
to: Routes.tag_index_path(@socket, :new),
class: "btn btn-primary"
) %>
<% else %>
<%= live_patch("New Tag",
to: Routes.tag_index_path(@socket, :new),
class: "btn btn-primary"
) %>
<% end %>
<div class="flex flex-row flex-wrap">
<%= for tag <- @tags do %>
<.tag_card tag={tag} />
<% end %>
</div>
</div>
<%= if @live_action in [:new, :edit] do %>
<%= live_modal(CanneryWeb.TagLive.FormComponent,
id: @tag.id || :new,
title: @page_title,
action: @live_action,
tag: @tag,
return_to: Routes.tag_index_path(@socket, :index),
current_user: @current_user
) %>
<% end %>