Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
primogenial
/
languages
/
wp-content-20241001222009
/
plugins
/
elementor
/
app
/
assets
/
js
/
layout
:
header-buttons.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import useAction from 'elementor-app/hooks/use-action'; import Button from './header-button'; export default function HeaderButtons( props ) { const action = useAction(); const actionOnClose = () => { if ( props.onClose ) { props.onClose(); } else { action.backToDashboard(); } }; let tools = ''; if ( props.buttons.length ) { const buttons = props.buttons.map( ( button ) => { return <Button key={ button.id } { ...button } />; } ); tools = ( <> { buttons } </> ); } return ( <div className="eps-app__header-buttons"> <Button text={ __( 'Close', 'elementor' ) } icon="eicon-close" className="eps-app__close-button" onClick={ actionOnClose } /> { tools } </div> ); } HeaderButtons.propTypes = { buttons: PropTypes.arrayOf( PropTypes.object ), onClose: PropTypes.func, }; HeaderButtons.defaultProps = { buttons: [], };