<% cache comment do %>
  <%= turbo_frame_tag comment do %>
    <div class="comment flex align-start full-width <%= "comment--system" if comment.creator.system? %>" data-creator-id="<%= comment.creator_id %>" data-created-by-current-user-target="creation">
      <figure class="comment__avatar flex-item-no-shrink" aria-hidden="true">
        <%= avatar_tag comment.creator, hidden_for_screen_reader: true %>
      </figure>

      <div class="comment__content flex flex-column flex-item-grow full-width">
        <div class="comment__author flex align-center gap-half">
          <strong>
            <%= link_to comment.creator.name, comment.creator, class: "txt-ink btn btn--plain fill-transparent", data: { turbo_frame: "_top" } %>
          </strong>

          <%= link_to comment, class: "txt-undecorated txt-ink translucent txt-normal txt-capitalize flex-item-justify-start" do %>
            <%= local_datetime_tag comment.created_at, style: :agoorweekday %>,
            <%= local_datetime_tag comment.created_at, style: :time %>
          <% end %>

          <%= link_to edit_card_comment_path(comment.card, comment),
                class: "comment__edit btn btn--circle borderless fill-transparent translucent" do %>
            <%= icon_tag "menu-dots-horizontal" %> <span class="for-screen-reader">Edit this comment</span>
          <% end %>

          <%= render "cards/comments/reactions/quick_reaction", comment: comment do %>
            <button class="comment__reaction btn btn--circle borderless fill-transparent" data-action="click->dialog#open:stop">
              <%= icon_tag "menu-dots-horizontal" %>
            </button>
          <% end %>
        </div>

        <div class="comment__body rich-text-content txt-align-start" data-controller="syntax-highlight retarget-links">
          <%= comment.body %>
        </div>

        <%= render "cards/comments/reactions/reactions", comment: comment %>
      </div>
    </div>
  <% end %>
<% end %>
