Add "previous posts" support to unified profiles in CC

The Community Console used to embed profiles from TW via an iframe, so
the logic to add the "previous posts" link was only added to TW.

However, the CC now renders the profiles without an iframe, with the
exact same layout as TW. This change adds support to add the "previous
posts" link in the CC, which reuses existing code (which has been
abstracted).

Fixed: twpowertools:78
Change-Id: I511af1e8aab1292f34beb712f29d52df9409e352
diff --git a/src/contentScripts/communityConsole/main.js b/src/contentScripts/communityConsole/main.js
index d16a863..6b32496 100644
--- a/src/contentScripts/communityConsole/main.js
+++ b/src/contentScripts/communityConsole/main.js
@@ -1,5 +1,6 @@
 import {injectScript, injectStyles, injectStylesheet} from '../../common/contentScriptsUtils.js';
 import {getOptions, isOptionEnabled} from '../../common/optionsUtils.js';
+import {injectPreviousPostsLinksUnifiedProfileIfEnabled} from '../utilsCommon/unifiedProfiles.js';
 
 import AvatarsHandler from './avatars.js';
 import {batchLock} from './batchLock.js';
@@ -22,6 +23,7 @@
   // Username span/editor inside ec-user (user profile view)
   'ec-user .main-card .header > .name > span',
   'ec-user .main-card .header > .name > ec-display-name-editor',
+  'ec-unified-user .scTailwindUser_profileUsercarddetails',
 
   // Rich text editor
   'ec-movable-dialog',
@@ -89,12 +91,20 @@
 
     // Show the "previous posts" links if the option is currently enabled.
     //   Here we're selecting the 'ec-user > div' element (unique child)
+
+    // TODO(b/twpowertools/80): Remove this:
     if (node.matches('ec-user .main-card .header > .name > span') ||
         node.matches(
             'ec-user .main-card .header > .name > ec-display-name-editor')) {
       injectPreviousPostsLinksIfEnabled(node);
     }
 
+    if (node.matches(
+            'ec-unified-user .scTailwindUser_profileUsercarddetails')) {
+      injectPreviousPostsLinksUnifiedProfileIfEnabled(
+          /* isCommunityConsole = */ true);
+    }
+
     // Fix the drag&drop issue with the rich text editor if the option is
     // currently enabled.
     //