PluginProbe
ElasticPress / 4.6.0
ElasticPress v4.6.0
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
elasticpress / assets / js / sync / components / sync / status.js

status.js in ElasticPress 4.6.0, at assets/js/sync/components/sync/status.js

41 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies.
3 */
4 import { Icon } from '@wordpress/components';
5 import { dateI18n } from '@wordpress/date';
6 import { WPElement } from '@wordpress/element';
7 import { __ } from '@wordpress/i18n';
8
9 /**
10 * Internal dependencies.
11 */
12 import DateTime from '../common/date-time';
13 import thumbsDown from '../icons/thumbs-down';
14 import thumbsUp from '../icons/thumbs-up';
15
16 /**
17 * Sync button component.
18 *
19 * @param {object} props Component props.
20 * @param {string} props.dateTime Sync date and time.
21 * @param {boolean} props.isSuccess If sync was a success.
22 * @returns {WPElement} Component.
23 */
24 export default ({ dateTime, isSuccess }) => {
25 return (
26 <p
27 className={`ep-sync-status ${
28 isSuccess ? `ep-sync-status--success` : `ep-sync-status--error`
29 }`}
30 >
31 <Icon icon={isSuccess ? thumbsUp : thumbsDown} />
32 <span className="ep-sync-status__label">
33 {isSuccess
34 ? __('Sync success on', 'elasticpress')
35 : __('Sync unsuccessful on', 'elasticpress')}{' '}
36 <DateTime dateTime={dateI18n('c', dateTime)} className="ep-sync-status__time" />
37 </span>
38 </p>
39 );
40 };
41