kgabryje commented on a change in pull request #18121:
URL: https://github.com/apache/superset/pull/18121#discussion_r789616863



##########
File path: superset-frontend/src/explore/components/QueryAndSaveBtns.tsx
##########
@@ -17,42 +17,37 @@
  * under the License.
  */
 import React from 'react';
-import PropTypes from 'prop-types';
 import ButtonGroup from 'src/components/ButtonGroup';
 import { t, useTheme } from '@superset-ui/core';
 
 import { Tooltip } from 'src/components/Tooltip';
-import Button from 'src/components/Button';
+import Button, { ButtonStyle, OnClickHandler } from 'src/components/Button';
 
-const propTypes = {
-  canAdd: PropTypes.bool.isRequired,
-  onQuery: PropTypes.func.isRequired,
-  onSave: PropTypes.func,
-  onStop: PropTypes.func,
-  loading: PropTypes.bool,
-  chartIsStale: PropTypes.bool,
-  errorMessage: PropTypes.node,
+export type QueryAndSaveBtnsProps = {
+  canAdd: boolean;
+  onQuery: OnClickHandler;
+  onSave: OnClickHandler;
+  onStop: OnClickHandler;
+  loading?: boolean;
+  chartIsStale?: boolean;
+  errorMessage: React.ReactElement | undefined;
 };
 
-const defaultProps = {
-  onStop: () => {},
-  onSave: () => {},
-};
-
-export default function QueryAndSaveBtns({
-  canAdd,
-  onQuery,
-  onSave,
-  onStop,
-  loading,
-  chartIsStale,
-  errorMessage,
-}) {
-  let qryButtonStyle = 'tertiary';
+export default function QueryAndSaveBtns(props: QueryAndSaveBtnsProps) {
+  const {
+    canAdd,
+    onQuery = () => {},
+    onSave = () => {},
+    onStop = () => {},
+    loading,
+    chartIsStale,
+    errorMessage,
+  } = props;
+  let qryButtonStyle = 'tertiary' as ButtonStyle;

Review comment:
       ```suggestion
     let qryButtonStyle: ButtonStyle = 'tertiary';
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to