hunk.code_window: import qualified Network.HTTP.Types                           as H
   import qualified Network.Wai.Extended                         as Wai
   import qualified Network.WebSockets                           as WS
   import qualified StmContainers.Map                            as STMMap
   import           Control.Concurrent.Extended                  (sleep)
   import           Control.Exception.Lifted
   import           Data.String
  
hunk.labels: keep keep keep add keep keep keep keep
hunk.after_edit: import qualified System.Metrics.Gauge                         as EKG.Gauge
  
hunk.file_path: server/src-lib/Hasura/GraphQL/Transport/WebSocket.hs
hunk.type: add
file: import React, { useState } from 'react';
  
  import {
    StyledSwitchButton,
    StyledSlider,
    StyledSwitchButtonProps,
  } from './SwitchButton';
  
  interface SwitchButtonProps extends StyledSwitchButtonProps {}
  
  export const SwitchButton: React.FC<SwitchButtonProps> = props => {
    const [isChecked, toggleCheckbox] = useState(false);
    const { children } = props;
  
    return (
      <StyledSwitchButton {...props}>
        <label>
          <input type="checkbox" onClick={() => toggleCheckbox(!isChecked)} />
          <StyledSlider checked={isChecked} />
          {children}
        </label>
      </StyledSwitchButton>
    );
  };
  