refactor(extra-info): migrate to the new DI architecture
Bug: twpowertools:226
Change-Id: Icaf98068bf5a272bf00a2b6b71e7ee40e3845d76
diff --git a/src/features/extraInfo/presentation/nodeWatcherHandlers/thread/ccExtraInfoThreadComment.handler.ts b/src/features/extraInfo/presentation/nodeWatcherHandlers/thread/ccExtraInfoThreadComment.handler.ts
new file mode 100644
index 0000000..f3e8c3c
--- /dev/null
+++ b/src/features/extraInfo/presentation/nodeWatcherHandlers/thread/ccExtraInfoThreadComment.handler.ts
@@ -0,0 +1,17 @@
+import CssSelectorNodeWatcherHandler from '../../../../../infrastructure/presentation/nodeWatcher/handlers/CssSelectorHandler.adapter';
+import { NodeMutation } from '../../../../../presentation/nodeWatcher/NodeWatcherHandler';
+import ExtraInfo from '../../../core';
+
+/** Inject extra info in comments. */
+export default class CCExtraInfoThreadCommentHandler extends CssSelectorNodeWatcherHandler {
+ cssSelector =
+ 'sc-tailwind-thread-message-message-list sc-tailwind-thread-message-comment-card';
+
+ constructor(private extraInfo: ExtraInfo) {
+ super();
+ }
+
+ onMutatedNode({ node }: NodeMutation) {
+ this.extraInfo.injectAtCommentIfEnabled(node);
+ }
+}