-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathissues-table-data-modal.js
54 lines (51 loc) · 1.38 KB
/
issues-table-data-modal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import GridiconExternal from 'gridicons/dist/external';
/**
* Internal dependencies
*/
import AppModal from '~/components/app-modal';
import AppButton from '~/components/app-button';
/**
* Renders a modal showing information about a Google Merchant Center issue
*
* @fires gla_documentation_link_click with { context: 'issues-data-table-modal' }
* @param {Object} props React props
* @param {Object} props.issue The issue to be rendered in the modal
* @param {Function} [props.onRequestClose] Callback function when closing the modal
*/
const IssuesTableDataModal = ( { issue, onRequestClose = () => {} } ) => {
return (
<AppModal
className="gla-issues-table-data-modal"
title={ issue.issue }
onRequestClose={ onRequestClose }
buttons={ [
<AppButton
key="learn-more"
isPrimary
target="_blank"
href={ issue.action_url }
text={ __( 'Learn more', 'google-listings-and-ads' ) }
eventName="gla_documentation_link_click"
eventProps={ {
context: 'issues-data-table-modal',
linkId: issue.code,
href: issue.action_url,
} }
icon={ <GridiconExternal /> }
/>,
] }
>
<p>
<strong>
{ __( 'What to do?', 'google-listings-and-ads' ) }
</strong>
</p>
<p>{ issue.action }</p>
</AppModal>
);
};
export default IssuesTableDataModal;