<% if (plugins.reactions) { %>

Overall users reactions from last <%= plugins.reactions?.comments %> comments

<% if (plugins.reactions.error) { %>
<%= plugins.reactions.error.message %>
<% } else { %>
<% for (const [reaction, icon] of Object.entries({HEART:"❤️", THUMBS_UP:"👍", THUMBS_DOWN:"👎", LAUGH:"😄", CONFUSED:"😕", EYES:"👀", ROCKET:"🚀", HOORAY:"🎉"})) { const {score = 0, value:count = 0} = plugins.reactions.list[reaction] ?? {} %>
<% if (score > 0) { %> <% if (plugins.reactions.twemoji) { %> <%= icon %> <% } else { %> <%= icon %> <% } %> <% } else { %> <% if (plugins.reactions.twemoji) { %> <%= icon %> <% } else { %> <%= icon %> <% } %> <% } %> <% if (plugins.reactions.details.length) { const [primary, secondary] = plugins.reactions.details %> <% if (primary === "count") { %> <%= count %> <% } else if (primary === "percentage") { %> <%= Math.round(score*100) %>% <% } %> <% if (secondary) { %> <% if (secondary === "count") { %> (<%= count %>) <% } else if (secondary === "percentage") { %> (<%= Math.round(score*100) %>%) <% } %> <% } %> <% } %>
<% } %>
<% } %>
<% } %>