PluginProbe
Extendify / 3.1.6
Extendify v3.1.6
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Agent / lib / notification-suggestion.js

notification-suggestion.js in Extendify 3.1.6, at src/Agent/lib/notification-suggestion.js

35 lines 868 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {
2 resolveNotificationLink,
3 siteHost,
4 } from '@notifications/notification-link';
5 import { notificationFor } from '@notifications/selection';
6
7 export const AGENT_CHAT_SLOT = 'agent-chat';
8
9 export const notificationSuggestion = () => {
10 const notification = notificationFor(AGENT_CHAT_SLOT);
11 if (!notification) return null;
12
13 const message = notification['content-agent-chat'];
14 const { href } = resolveNotificationLink(notification, siteHost());
15 if (!message || !href) return null;
16
17 const slug = notification.slug;
18 const source = notification.source;
19
20 return {
21 id: `notification-${slug}`,
22 type: 'external-link',
23 message,
24 url: href,
25 viewTelemetry: {
26 key: 'notification_view',
27 payload: { slug, slot: AGENT_CHAT_SLOT, source },
28 },
29 telemetry: {
30 key: 'notification_click',
31 payload: { slug, slot: AGENT_CHAT_SLOT, source },
32 },
33 };
34 };
35