hunk.code_window:   });
   }
   class DocumentationSearch extends React.Component<Props, State> {
     constructor(props: Props) {
       super(props);
       this.state = {
  
hunk.labels: keep keep add keep keep keep keep
hunk.after_edit: export function bootIntercom(intercomAppID: string, user?: User) {
     if (intercomAppID && window.Intercom) {
       window.Intercom("boot", {
         app_id: intercomAppID,
         user_id: user?.username,
         name: user?.name,
         email: user?.email,
       });
     }
   }
  
hunk.file_path: app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx
hunk.type: add
file: import React, { createRef, useState } from "react";
  import styled from "styled-components";
  import copy from "copy-to-clipboard";
  import TextInput from "components/ads/TextInput";
  import Button, { Category, Size } from "components/ads/Button";
  
  const Wrapper = styled.div`
    display: flex;
  
    div {
      flex-basis: calc(100% - 110px);
    }
    a {
      flex-basis: 110px;
    }
  `;
  
  function CopyToClipboard(props: any) {
    const { copyText } = props;
    const copyURLInput = createRef<HTMLInputElement>();
    const [isCopied, setIsCopied] = useState(false);
  
    const copyToClipboard = (url: string) => {
      copy(url);
      setIsCopied(true);
      setTimeout(() => {
        setIsCopied(false);
      }, 3000);
    };
  
    const selectText = () => {
      if (copyURLInput.current) {
        copyURLInput.current.setSelectionRange(0, copyText.length);
      }
    };
    return (
      <Wrapper>
        <TextInput
          defaultValue={copyText}
          fill
          onChange={() => {
            selectText();
          }}
          readOnly
          ref={copyURLInput}
        />
  
        <Button
          category={Category.tertiary}
          onClick={() => {
            copyToClipboard(copyText);
          }}
          size={Size.large}
          text={isCopied ? "Copied" : "Copy"}
        />
      </Wrapper>
    );
  }
  
  export default CopyToClipboard;
  