Skip to content

A platform for community discussion. Free, open, simple.

DEV: Introduce topic-link PluginOutlet (#30792)

David Taylorda72ad4ecddf
diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-link.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-link.gjs
index 2033c31d806..581e1edf9db 100644
--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-link.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-link.gjs
@@ -1,5 +1,7 @@
import Component from "@glimmer/component";
+import { hash } from "@ember/helper";
import { htmlSafe } from "@ember/template";
+import PluginOutlet from "discourse/components/plugin-outlet";
export default class TopicLink extends Component {
get url() {
@@ -10,14 +12,18 @@ export default class TopicLink extends Component {
<template>
{{~! no whitespace ~}}
- <a
- href={{this.url}}
- data-topic-id={{@topic.id}}
- role="heading"
- aria-level="2"
- class="title"
- ...attributes
- >{{htmlSafe @topic.fancyTitle}}</a>
+ <PluginOutlet @name="topic-link" @outletArgs={{hash topic=@topic}}>
+ {{~! no whitespace ~}}
+ <a
+ href={{this.url}}
+ data-topic-id={{@topic.id}}
+ role="heading"
+ aria-level="2"
+ class="title"
+ ...attributes
+ >{{htmlSafe @topic.fancyTitle}}</a>
+ {{~! no whitespace ~}}
+ </PluginOutlet>
{{~! no whitespace ~}}
</template>
}