eschutho commented on a change in pull request #13676:
URL: https://github.com/apache/superset/pull/13676#discussion_r599175491



##########
File path: superset-frontend/src/SqlLab/components/SouthPane.tsx
##########
@@ -83,33 +77,34 @@ const StyledPane = styled.div`
   }
 `;
 
-export class SouthPane extends React.PureComponent {
-  constructor(props) {
-    super(props);
-    this.southPaneRef = React.createRef();
-    this.switchTab = this.switchTab.bind(this);
-  }
+function SouthPane({
+  editorQueries,
+  latestQueryId,
+  dataPreviewQueries,
+  actions,
+  activeSouthPaneTab = 'Results',
+  height,
+  databases,
+  offline = false,
+  displayLimit,
+}: SouthPanePropTypes) {
+  const innerTabContentHeight = height - TAB_HEIGHT;
+  const southPaneRef: any = useRef();
+  const switchTab = (id: string) => {
+    actions.setActiveSouthPaneTab(id);
+  };
 
-  switchTab(id) {
-    this.props.actions.setActiveSouthPaneTab(id);
-  }
+  const renderOfflineStatus = () => (
+    <Label className="m-r-3" type={STATE_TYPE_MAP[STATUS_OPTIONS.offline]}>
+      {STATUS_OPTIONS.offline}
+    </Label>
+  );
 
-  render() {
-    if (this.props.offline) {
-      return (
-        <Label className="m-r-3" type={STATE_TYPE_MAP[STATUS_OPTIONS.offline]}>
-          {STATUS_OPTIONS.offline}
-        </Label>
-      );
-    }
-    const innerTabContentHeight = this.props.height - TAB_HEIGHT;
+  const renderResults = () => {
     let latestQuery;
-    const { props } = this;
-    if (props.editorQueries.length > 0) {
+    if (editorQueries.length > 0) {
       // get the latest query
-      latestQuery = props.editorQueries.find(
-        q => q.id === this.props.latestQueryId,
-      );
+      latestQuery = editorQueries.find(q => q.id === latestQueryId);

Review comment:
       you can destructure the id for a little shorter syntax




-- 
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.

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