{"version":3,"file":"button_with_spinner-C897WIws.js","sources":["../../app/javascript/components/button_with_spinner.jsx"],"sourcesContent":["// Third-party imports.\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\nclass ButtonWithSpinner extends React.Component {\n static propTypes = {\n // Text on the button.\n text: PropTypes.string.isRequired,\n dataAnalyticsId: PropTypes.string,\n\n // Optional: This is used if you want to explicitly pass a function to call.\n // This is not necessary if you are using this is as a button to a form.\n onClick: PropTypes.func,\n\n // When this is true, hide the text and display the spinning animation. When it is false,\n // display the text and hide the animation.\n isSpinning: PropTypes.bool.isRequired,\n\n // Optional. If true, disable clicking on the button.\n isDisabled: PropTypes.bool,\n };\n\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n render() {\n // TODO: Make sure this is not breaking anything\n let inputElement = null;\n\n if (this.props.onClick !== null) {\n inputElement = (\n \n );\n } else {\n inputElement = (\n \n );\n }\n\n const spinElement = this.props.isSpinning ?
: null;\n\n return (\n