hunk.code_window:     this.state = {
         showResults: props.defaultRefinement.length > 0,
       };
     }
     componentDidMount() {
       const { user } = this.props;
       if (intercomAppID && window.Intercom) {
         window.Intercom("boot", {
           app_id: intercomAppID,
           user_id: user?.username,
           name: user?.name,
           email: user?.email,
         });
       }
     }
     onSearchValueChange = (event: SyntheticEvent<HTMLInputElement, Event>) => {
       // eslint-disable-next-line @typescript-eslint/ban-ts-comment
       // @ts-ignore: No types available
       const value = event.target.value;
  
hunk.labels: keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep
hunk.file_path: app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx
hunk.type: replace
file: import React, { useState } from "react";
  import { useDispatch, useSelector } from "react-redux";
  import { setThemeMode } from "actions/themeActions";
  import Switch from "components/ads/RectangularSwitcher";
  import MenuItem from "components/ads/MenuItem";
  import { getCurrentThemeMode, ThemeMode } from "selectors/themeSelectors";
  
  export default function ThemeSwitcher(props: { className?: string }) {
    const dispatch = useDispatch();
    const themeMode = useSelector(getCurrentThemeMode);
    const [switchedOn, setSwitchOn] = useState(themeMode === ThemeMode.DARK);
  
    return (
      <MenuItem
        label={
          <Switch
            className={props.className}
            onSwitch={(value) => {
              setSwitchOn(value);
              dispatch(setThemeMode(value ? ThemeMode.DARK : ThemeMode.LIGHT));
            }}
            value={switchedOn}
          />
        }
        text="Theme"
      />
    );
  }
  