<commit_before>import { Input, Menu } from "antd";
import React from "react";
import styled from "styled-components";
import { grey6 } from "../../../../styles/colors";
import { primaryColour, theme } from "../../../../utilities/theme-utilities";
import { setBaseUrl } from "../../../../utilities/url-utilities";
import { IconSearch } from "../../../icons/Icons";

const SearchForm = styled.form`
  background-color: transparent;
  color: ${theme === "dark" ? "#fff" : "#000"};
  width: 300px;
  margin-right: 15px;

  .ant-input-prefix svg {
    color: ${grey6};
    font-size: 14px;
  }

  input {
    border-bottom: 2px solid ${primaryColour};
  }
`;

/**
 * React component to render a global search input to the main navigation.
 * @returns {JSX.Element}
 * @constructor
 */
export function GlobalSearch() {
  return (
    <SearchForm method="get" action={setBaseUrl("/search")}>
      <Input
        name="query"
        className="t-global-search"
        prefix={<IconSearch />}
        placeholder={i18n("nav.main.search")}
      />
    </SearchForm>
  );
}<commit_msg>Allow clear and no autocomplete for glabal search<commit_after>import { Input, Menu } from "antd";
import React from "react";
import styled from "styled-components";
import { grey6 } from "../../../../styles/colors";
import { primaryColour, theme } from "../../../../utilities/theme-utilities";
import { setBaseUrl } from "../../../../utilities/url-utilities";
import { IconSearch } from "../../../icons/Icons";

const SearchForm = styled.form`
  background-color: transparent;
  color: ${theme === "dark" ? "#fff" : "#000"};
  width: 300px;
  margin-right: 15px;

  .ant-input-prefix svg {
    color: ${grey6};
    font-size: 14px;
  }

  .anticon-close-circle svg {
    color: ${grey6};
  }

  input {
    border-bottom: 2px solid ${primaryColour};
  }
`;

/**
 * React component to render a global search input to the main navigation.
 * @returns {JSX.Element}
 * @constructor
 */
export function GlobalSearch() {
  return (
    <SearchForm method="get" action={setBaseUrl("/search")}>
      <Input
        name="query"
        allowClear
        autoComplete="off"
        className="t-global-search"
        prefix={<IconSearch />}
        placeholder={i18n("nav.main.search")}
      />
    </SearchForm>
  );
}
{'fraction_non_alphanumeric': 0.1826503923278117, 'fraction_numerical': 0.013513513513513514, 'mean_word_length': 2.8506711409395975, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5330102', 'n_tokens_mistral': 736, 'n_tokens_neox': 709, 'n_words': 179}