{"size": 731, "ext": "js", "max_stars_repo_path": "src/components/search-input/index.js", "max_stars_repo_name": "SuZHui/SuZHUI.github.io", "max_stars_repo_stars_event_min_datetime": "2020-04-16T13:09:48.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-16T13:09:48.000Z", "max_issues_repo_path": "src/components/search-input/index.js", "max_issues_repo_name": "SuZHui/SuZHUI.github.io", "max_issues_repo_issues_event_min_datetime": "2020-10-22T02:54:05.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T12:07:39.000Z", "max_forks_repo_path": "src/components/search-input/index.js", "max_forks_repo_name": "SuZHui/SuZHui.github.io", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 27.0740740741, "max_line_length": 71, "alphanum_fraction": 0.6046511628}
import React, { useState } from "react";
import style from "./search-input.module.scss";
import Icon, { ICON_SEARCH } from "../icon";

function SearchInput() {
  const [inputValue, setValue] = useState("");
  const [isFocus, setFocusState] = useState(false);

  return (
    <div className={style.searchInput}>
      <input
        maxLength='30'
        className={`${style.input} ${isFocus ? style.inputFocus : ""}`}
        value={inputValue}
        onChange={e => setValue(e.target.value)}
        onFocus={() => setFocusState(true)}
        onBlur={() => setFocusState(false)}
      />
      <button className={style.button}>
        <Icon name={ICON_SEARCH} />
      </button>
    </div>
  );
}

export default SearchInput;
