<%# locals: (category:) %> <% is_selected = category.id === @selected_category&.id %> <%= content_tag :div, class: ["filterable-item flex justify-between items-center border-none rounded-lg px-2 py-1 group w-full", { "bg-gray-25": is_selected }], data: { filter_name: category.name } do %> <%= button_to account_transaction_category_path( @transaction.entry, account_entry: { entryable_type: "Account::Transaction", entryable_attributes: { id: @transaction.id, category_id: category.id } } ), method: :patch, class: "flex w-full items-center gap-1.5 cursor-pointer" do %> <%= lucide_icon("check", class: "w-5 h-5 text-gray-500") if is_selected %> <% if category.subcategory? %> <%= lucide_icon "corner-down-right", class: "shrink-0 w-5 h-5 text-gray-400" %> <% end %> <%= render partial: "categories/badge", locals: { category: category } %> <% end %> <%= contextual_menu do %>
<%= link_to edit_category_path(category), class: "block w-full py-2 px-3 space-x-2 text-gray-900 hover:bg-gray-50 flex items-center rounded-lg", data: { turbo_frame: :modal } do %> <%= lucide_icon "pencil-line", class: "w-5 h-5 text-gray-500" %> <%= t(".edit") %> <% end %> <%= link_to new_category_deletion_path(category), class: "block w-full py-2 px-3 space-x-2 text-red-600 hover:bg-red-50 flex items-center rounded-lg", data: { turbo_frame: :modal } do %> <%= lucide_icon "trash-2", class: "w-5 h-5" %> <%= t(".delete") %> <% end %>
<% end %> <% end %>