Files
sure/app/views/chats/_chat.html.erb
Alex Hatzenbuhler 5c82af0e8c Fix and improve chat title edit (#2285)
* Fix and improve chat title edit

* Put back background color

* use transparent
2025-05-23 15:31:08 -04:00

31 lines
893 B
Plaintext

<%# locals: (chat:) %>
<%= tag.div class: "flex items-center justify-between px-4 py-3 bg-container shadow-border-xs rounded-lg" do %>
<div class="grow">
<%= turbo_frame_tag dom_id(chat, :title) do %>
<%= render "chats/chat_title", chat: chat, ctx: "list" %>
<% end %>
<p class="text-sm text-secondary">
<%= time_ago_in_words(chat.updated_at) %> ago
</p>
</div>
<%= render MenuComponent.new(icon_vertical: true) do |menu| %>
<% menu.with_item(
variant: "link",
text: "Edit chat title",
href: edit_chat_path(chat, ctx: "list"),
icon: "pencil",
frame: dom_id(chat, "title")) %>
<% menu.with_item(
variant: "button",
text: "Delete chat",
href: chat_path(chat),
icon: "trash-2",
method: :delete,
confirm: CustomConfirm.for_resource_deletion("chat")) %>
<% end %>
<% end %>