| 1 |
/** |
| 2 |
* WordPress dependencies. |
| 3 |
*/ |
| 4 |
import { WPElement } from '@wordpress/element'; |
| 5 |
|
| 6 |
/** |
| 7 |
* Internal dependencies. |
| 8 |
*/ |
| 9 |
import { useSync } from '../../sync'; |
| 10 |
import PreviousSync from './previous-sync'; |
| 11 |
|
| 12 |
/** |
| 13 |
* Delete checkbox component. |
| 14 |
* |
| 15 |
* @returns {WPElement} Sync page component. |
| 16 |
*/ |
| 17 |
export default () => { |
| 18 |
const { syncHistory } = useSync(); |
| 19 |
|
| 20 |
const previousSyncs = syncHistory.slice(0, 5); |
| 21 |
|
| 22 |
return ( |
| 23 |
<ol className="ep-sync-history"> |
| 24 |
{previousSyncs.map((s) => { |
| 25 |
return ( |
| 26 |
<li key={s.start_date_time}> |
| 27 |
<PreviousSync |
| 28 |
failures={s.failed} |
| 29 |
method={s.method} |
| 30 |
stateDatetime={s.start_date_time} |
| 31 |
status={s.final_status} |
| 32 |
trigger={s.trigger} |
| 33 |
/> |
| 34 |
</li> |
| 35 |
); |
| 36 |
})} |
| 37 |
</ol> |
| 38 |
); |
| 39 |
}; |
| 40 |
|