| 1 |
import Button from 'elementor-app/ui/molecules/button'; |
| 2 |
|
| 3 |
import useAction from 'elementor-app/hooks/use-action'; |
| 4 |
|
| 5 |
import { arrayToClassName } from 'elementor-app/utils/utils.js'; |
| 6 |
|
| 7 |
export default function DashboardButton( props ) { |
| 8 |
const action = useAction(), |
| 9 |
baseClassName = 'e-app-dashboard-button', |
| 10 |
classes = [ baseClassName, props.className ]; |
| 11 |
|
| 12 |
return ( |
| 13 |
<Button |
| 14 |
{ ...props } |
| 15 |
className={ arrayToClassName( classes ) } |
| 16 |
text={ props.text } |
| 17 |
onClick={ action.backToDashboard } |
| 18 |
/> |
| 19 |
); |
| 20 |
} |
| 21 |
|
| 22 |
DashboardButton.propTypes = { |
| 23 |
className: PropTypes.string, |
| 24 |
text: PropTypes.string, |
| 25 |
}; |
| 26 |
|
| 27 |
DashboardButton.defaultProps = { |
| 28 |
className: '', |
| 29 |
variant: 'contained', |
| 30 |
color: 'primary', |
| 31 |
text: __( 'Back to dashboard', 'elementor' ), |
| 32 |
}; |
| 33 |
|