<%=
has_vote = Map.has_key?(@votes, post.id)
is_upvote = has_vote && @votes[post.id].is_up
""
%>
<%= link "", to: "#", phx_click: "upvote", phx_value_id: post.id, class: "bi bi-arrow-up-circle#{if has_vote && is_upvote, do: "-fill", else: ""}" %>
<%= post.score %>
<%= link "", to: "#", phx_click: "downvote", phx_value_id: post.id, class: "bi bi-arrow-down-circle#{if has_vote && !is_upvote, do: "-fill", else: ""}" %>
<%= if !is_nil(post.upload) do %>
<%= live_redirect to: Routes.post_show_path(@socket, :show, @room, post) do %>
<% end %>
<% end %>
<%= live_redirect to: Routes.post_show_path(@socket, :show, @room, post) do %>
<%= post.title %>
<% end %>
aggie/<%= post.user.username %>
<%= post.body %>
<%= if Aggiedit.Roles.guard?(@current_user, :edit, post) && Aggiedit.Roles.guard?(@current_user, :edit, post) do %>
<%= live_patch "Edit", to: Routes.post_index_path(@socket, :edit, @room, post) %>
<%= link "Delete", to: "#", phx_click: "delete", phx_value_id: post.id %>
<% end %>