<%# locals: (chat:, ctx: "list") %>

<%= turbo_frame_tag dom_id(chat, :title), class: "block" do %>
  <% if chat.new_record? || ctx == "chat" %>
    <h3 class="text-sm font-medium text-primary"><%= chat.title || "New chat" %></h3>
  <% else %>
    <%= link_to chat_path(chat), data: { turbo_frame: chat_frame } do %>
      <h3 class="truncate text-sm font-medium text-primary"><%= chat.title %></h3>
    <% end %>
  <% end %>
<% end %>
