/** * External dependencies */ import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { Notice, Button } from '@wordpress/components'; /** * Internal dependencies */ import { default as commands } from './commands'; import { STORE_KEY } from './data/constants'; import './data'; function Tools( { actions, currentlyRunningCommands, messages } ) { actions = actions(); return (

Tools

This section contains miscellaneous tools.

{ Object.keys( messages ).map( ( key ) => { return ( { key }: { messages[ key ].message } ); } ) } { commands.map( ( command, index ) => { return ( ); } ) }
Command Description Run
{ command.command } { command.description }
); } export default compose( withSelect( ( select ) => { const { getCurrentlyRunning, getMessages } = select( STORE_KEY ); return { currentlyRunningCommands: getCurrentlyRunning(), messages: getMessages(), }; } ), withDispatch( ( dispatch ) => { const actions = function () { return dispatch( STORE_KEY ); }; return { actions, }; } ) )( Tools );