FEATURE: Add more class names to latest-topic-list-item (#12933)

FEATURE: Add more class names to latest-topic-list-item (#12933)

diff --git a/app/assets/javascripts/discourse/app/components/latest-topic-list-item.js b/app/assets/javascripts/discourse/app/components/latest-topic-list-item.js
index 96fc931..d6cb634 100644
--- a/app/assets/javascripts/discourse/app/components/latest-topic-list-item.js
+++ b/app/assets/javascripts/discourse/app/components/latest-topic-list-item.js
@@ -3,15 +3,11 @@ import {
   showEntrance,
 } from "discourse/components/topic-list-item";
 import Component from "@ember/component";
+import discourseComputed from "discourse-common/utils/decorators";
 
 export default Component.extend({
   attributeBindings: ["topic.id:data-topic-id"],
-  classNameBindings: [
-    ":latest-topic-list-item",
-    "topic.archived",
-    "topic.visited",
-    "topic.pinned",
-  ],
+  classNameBindings: [":latest-topic-list-item", "unboundClassNames"],
 
   showEntrance,
   navigateToTopic,
@@ -27,4 +23,27 @@ export default Component.extend({
 
   // Can be overwritten by plugins to handle clicks on other parts of the row
   unhandledRowClick() {},
+
+  @discourseComputed("topic")
+  unboundClassNames(topic) {
+    let classes = [];
+
+    if (topic.get("category")) {
+      classes.push("category-" + topic.get("category.fullSlug"));
+    }
+
+    if (topic.get("tags")) {
+      topic.get("tags").forEach((tagName) => classes.push("tag-" + tagName));
+    }
+
+    ["liked", "archived", "bookmarked", "pinned", "closed", "visited"].forEach(
+      (name) => {
+        if (topic.get(name)) {
+          classes.push(name);
+        }
+      }
+    );
+
+    return classes.join(" ");
+  },
 });

GitHub sha: f57878f2

This commit appears in #12933 which was approved by eviltrout. It was merged by awesomerobot.