<%= gettext("Tags") %>

<%= gettext("Tags can be added to your containers to help you organize") %>

<%= if @tags |> Enum.empty?() and @search |> is_nil() do %>

<%= gettext("No tags") %> <%= display_emoji("😔") %>

<.link patch={Routes.tag_index_path(Endpoint, :new)} class="btn btn-primary"> <%= dgettext("actions", "Make your first tag!") %> <% else %> <.link patch={Routes.tag_index_path(Endpoint, :new)} class="btn btn-primary"> <%= dgettext("actions", "New Tag") %> <% end %>
<.form :let={f} for={%{}} as={:search} phx-change="search" phx-submit="search" class="grow self-stretch flex flex-col items-stretch" > <%= text_input(f, :search_term, class: "input input-primary", value: @search, role: "search", phx_debounce: 300, placeholder: gettext("Search tags") ) %>
<%= if @tags |> Enum.empty?() do %>

<%= gettext("No tags") %> <%= display_emoji("😔") %>

<% else %>
<.tag_card :for={tag <- @tags} tag={tag}> <.link patch={Routes.tag_index_path(Endpoint, :edit, tag)} class="text-primary-600 link" aria-label={dgettext("actions", "Edit %{tag_name}", tag_name: tag.name)} > <.link href="#" class="text-primary-600 link" phx-click="delete" phx-value-id={tag.id} data-confirm={ dgettext("prompts", "Are you sure you want to delete %{name}?", name: tag.name) } aria-label={dgettext("actions", "Delete %{tag_name}", tag_name: tag.name)} >
<% end %>
<.modal :if={@live_action in [:new, :edit]} return_to={Routes.tag_index_path(Endpoint, :index)}> <.live_component module={CanneryWeb.TagLive.FormComponent} id={@tag.id || :new} title={@page_title} action={@live_action} tag={@tag} return_to={Routes.tag_index_path(Endpoint, :index)} current_user={@current_user} />