{"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
\n {inputElement}\n\n
{spinElement}
\n
\n );\n }\n}\n\nexport default ButtonWithSpinner;\n"],"names":["ButtonWithSpinner","React","props","inputElement","jsx","spinElement","jsxs","__publicField","PropTypes"],"mappings":"moBAIA,MAAMA,UAA0BC,EAAM,SAAU,CAkB9C,YAAYC,EAAO,CACjB,MAAMA,CAAK,EACX,KAAK,MAAQ,CAAC,CAAA,CAGhB,QAAS,CAEP,IAAIC,EAAe,KAEf,KAAK,MAAM,UAAY,KAEvBA,EAAAC,EAAA,IAAC,QAAA,CACC,KAAK,SACL,oBAAmB,KAAK,MAAM,gBAC9B,UAAW,kBAAkB,KAAK,MAAM,WAAa,mBAAqB,EAAE,GAC5E,MAAO,KAAK,MAAM,KAClB,SAAU,KAAK,MAAM,WACrB,QAAS,KAAK,MAAM,QACpB,MAAO,CAAE,MAAO,GAAG,KAAK,WAAW,KAAM,CAAA,CAC3C,EAIAD,EAAAC,EAAA,IAAC,QAAA,CACC,KAAK,SACL,oBAAmB,KAAK,MAAM,gBAC9B,UAAW,kBAAkB,KAAK,MAAM,WAAa,mBAAqB,EAAE,GAC5E,MAAO,KAAK,MAAM,KAClB,SAAU,KAAK,MAAM,WACrB,MAAO,CAAE,MAAO,GAAG,KAAK,WAAW,KAAM,CAAA,CAC3C,EAIE,MAAAC,EAAc,KAAK,MAAM,iBAAc,MAAI,CAAA,UAAU,cAAe,CAAA,EAAK,KAG7E,OAAAC,EAAA,KAAC,MAAI,CAAA,UAAU,sBACZ,SAAA,CAAAH,EAEAC,EAAA,IAAA,MAAA,CAAI,UAAU,iBAAkB,SAAYC,CAAA,CAAA,CAAA,EAC/C,CAAA,CAGN,CA7DEE,EADIP,EACG,YAAY,CAEjB,KAAMQ,EAAU,OAAO,WACvB,gBAAiBA,EAAU,OAI3B,QAASA,EAAU,KAInB,WAAYA,EAAU,KAAK,WAG3B,WAAYA,EAAU,IACxB"}