# elementor/3.8.0-beta1/app/assets/js/layout/header-buttons.js

Elementor Website Builder – more than just a page builder, version 3.8.0-beta1. 51 lines.

- Page: https://pluginprobe.com/plugins/elementor/3.8.0-beta1/code/app/assets/js/layout/header-buttons.js
- Raw: https://pluginprobe.com/plugins/elementor/3.8.0-beta1/raw/app/assets/js/layout/header-buttons.js
- Modified: 2022-09-19T16:26:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/3.8.0-beta1/code/app/assets/js/layout/header-buttons.js#L10-L20`.

```javascript
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: [],
};

```
