DEV: render-invitee helper

DEV: render-invitee helper

diff --git a/assets/javascripts/discourse/templates/modal/post-event-invitees.hbs b/assets/javascripts/discourse/templates/modal/post-event-invitees.hbs
index 1fb55c8..846ffaf 100644
--- a/assets/javascripts/discourse/templates/modal/post-event-invitees.hbs
+++ b/assets/javascripts/discourse/templates/modal/post-event-invitees.hbs
@@ -10,12 +10,7 @@
   <ul class="invitees">
     {{#each invitees as |invitee|}}
       <li class="invitee">
-        <span class="user">
-          {{avatar invitee.user imageSize="medium"}}
-          <span class="username">
-            {{format-username invitee.user.username}}
-          </span>
-        </span>
+        {{render-invitee invitee}}
         {{#if invitee.status}}
           <span class="status {{invitee.status}}">
             {{i18n (concat "event.invitee_status." invitee.status)}}
diff --git a/assets/javascripts/helpers/render-invitee.js.es6 b/assets/javascripts/helpers/render-invitee.js.es6
new file mode 100644
index 0000000..6da0395
--- /dev/null
+++ b/assets/javascripts/helpers/render-invitee.js.es6
@@ -0,0 +1,21 @@
+import { renderAvatar } from "discourse/helpers/user-avatar";
+import { userPath } from "discourse/lib/url";
+import { htmlHelper } from "discourse-common/lib/helpers";
+import { htmlSafe } from "@ember/template";
+import { formatUsername } from "discourse/lib/utilities";
+
+export default htmlHelper(invitee => {
+  const path = userPath(invitee.user.username);
+  const template = `
+    <a href="${path}" data-user-card="${invitee.user.username}">
+      <span class="user">
+        ${renderAvatar(invitee.user, { imageSize: "medium" })}
+        <span class="username">
+         ${formatUsername(invitee.user.username)}
+        </span>
+      </span>
+    </a>
+  `;
+
+  return htmlSafe(template);
+});

GitHub sha: 43c62d6c