/** * 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, comandParams, } ) { actions = actions(); return (

Tools

This section contains miscellaneous tools.

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