import React from 'react'; import SilverStripeComponent from 'silverstripe-component'; class FormActionComponent extends SilverStripeComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } render() { return ( ); } /** * Returns the necessary button classes based on the given props * * @returns string */ getButtonClasses() { let buttonClasses = 'btn'; // Add 'type' class buttonClasses += ` btn-${this.props.style}`; // If there is no text if (typeof this.props.label === 'undefined') { buttonClasses += ' no-text'; } // Add icon class if (typeof this.props.icon !== 'undefined') { buttonClasses += ` font-icon-${this.props.icon}`; } // Add loading class if (this.props.loading === true) { buttonClasses += ' btn--loading'; } // Add disabled class if (this.props.disabled === true) { buttonClasses += ' disabled'; } return buttonClasses; } /** * Returns markup for the loading icon * * @returns object|null */ getLoadingIcon() { if (this.props.loading) { return (