| 1 |
import { notificationSuggestion } from '@agent/lib/notification-suggestion'; |
| 2 |
import { track } from '@shared/lib/track'; |
| 3 |
import { __ } from '@wordpress/i18n'; |
| 4 |
|
| 5 |
export default { |
| 6 |
id: 'agent-chat-notification', |
| 7 |
follows: '*', |
| 8 |
statuses: ['completed', 'canceled'], |
| 9 |
data: notificationSuggestion, |
| 10 |
score: ({ data }) => (data ? 0.04 : 0), |
| 11 |
content: ({ message, content, ctaLabel, url }) => ({ |
| 12 |
title: message, |
| 13 |
body: content, |
| 14 |
action: { |
| 15 |
label: |
| 16 |
ctaLabel || |
| 17 |
// translators: Button on a card in the AI Agent chat that opens a partner's offer in a new tab. |
| 18 |
__('Learn more', 'extendify-local'), |
| 19 |
url, |
| 20 |
}, |
| 21 |
}), |
| 22 |
onView: ({ viewTelemetry }) => |
| 23 |
track(viewTelemetry.key, viewTelemetry.payload), |
| 24 |
onClick: ({ telemetry }) => track(telemetry.key, telemetry.payload), |
| 25 |
}; |
| 26 |
|