Pull group message summary behaviour into its own class

Pull group message summary behaviour into its own class

diff --git a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
index 8e3afc9..2140cc9 100644
--- a/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
+++ b/app/assets/javascripts/discourse/widgets/default-notification-item.js.es6
@@ -112,14 +112,6 @@ export const DefaultNotificationItem =
       const scope =
         notificationName === "custom" ? data.message : `notifications.${notificationName}`;
 
-      const notificationTypes = this.site.notification_types;
-
-      if (notificationType === notificationTypes.group_message_summary) {
-        const count = data.inbox_count;
-        const group_name = data.group_name;
-        return I18n.t(scope, { count, group_name });
-      }
-
       const username = formatUsername(data.display_username);
       const description = this.description();
 
diff --git a/app/assets/javascripts/discourse/widgets/group-message-summary-notification-item.js.es6 b/app/assets/javascripts/discourse/widgets/group-message-summary-notification-item.js.es6
new file mode 100644
index 0000000..8cf0d3c
--- /dev/null
+++ b/app/assets/javascripts/discourse/widgets/group-message-summary-notification-item.js.es6
@@ -0,0 +1,13 @@
+import { createWidgetFrom } from "discourse/widgets/widget";
+import { DefaultNotificationItem } from "discourse/widgets/default-notification-item";
+
+createWidgetFrom(DefaultNotificationItem, "group-message-summary-notification-item", {
+  text(notificationType, notificationName) {
+    const { attrs } = this;
+    const data = attrs.data;
+    const count = data.inbox_count;
+    const group_name = data.group_name;
+
+    return I18n.t("notifications.group_message_summary", { count, group_name });
+  }
+});

GitHub sha: 36d7abed