PluginProbe
Extendify / 3.2.2
Extendify v3.2.2
3.2.2 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 All 128 releases
extendify / src / Agent / follow-ups / cards / register-domain.js

register-domain.js in Extendify 3.2.2, at src/Agent/follow-ups/cards/register-domain.js

31 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { domainOffer } from '@agent/lib/domain-suggestion';
2 import { useDomainActivities } from '@agent/state/domain-activities';
3 import { __ } from '@wordpress/i18n';
4
5 const record = ({ tracking }, action) =>
6 useDomainActivities.getState().setDomainActivity({ ...tracking, action });
7
8 export default {
9 id: 'register-domain',
10 follows: '*',
11 statuses: ['completed', 'canceled'],
12 data: domainOffer,
13 // Under 0.1 so a taken card scoring 1 or more still wins.
14 score: ({ data }) => (data ? 0.05 : 0),
15 content: ({ message, url }) => ({
16 title: message,
17 // translators: Body of a card in the AI Agent chat that offers to register a domain name for the website.
18 body: __(
19 'Your own domain makes your site easier to find and remember.',
20 'extendify-local',
21 ),
22 action: {
23 // translators: Button on a card in the AI Agent chat that opens a domain registrar in a new tab.
24 label: __('Register this domain', 'extendify-local'),
25 url,
26 },
27 }),
28 onView: (data) => record(data, 'viewed'),
29 onClick: (data) => record(data, 'clicked'),
30 };
31