{"size": 1170, "ext": "js", "max_stars_repo_path": "src/components/InputSearch/index.js", "max_stars_repo_name": "loressl/search-nasa", "max_stars_repo_stars_event_min_datetime": "2021-02-08T17:17:05.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-26T20:28:14.000Z", "max_issues_repo_path": "src/components/InputSearch/index.js", "max_issues_repo_name": "loressl/search-nasa", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/InputSearch/index.js", "max_forks_repo_name": "loressl/search-nasa", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.8571428571, "max_line_length": 80, "alphanum_fraction": 0.4760683761}
import React from 'react'
import {
    InputGroup,
    InputGroupAddon,
    Input,
    Button,
    Tooltip
} from 'reactstrap'

function InputSearch({setFieldSearch, onSubmit, ...props}) {
    return (
        <InputGroup>
            <Input
                id="fieldSearch"
                placeholder="Type here..."
                value={props.fieldSearch}
                onChange={event => setFieldSearch(event.target.value)}
                onKeyPress={event => {
                    if (event.key === "Enter") {
                        onSubmit()
                    }
                }}
            />
            <Tooltip
                placement="top-start"
                isOpen={props.tooltipOpen}
                target="fieldSearch"
                toggle={props.toggle}
            >
                For a better experience, type in English only
            </Tooltip>
            <InputGroupAddon addonType="append">
                <Button onClick={onSubmit} style={props.button} color="primary">
                    Search
                </Button>
            </InputGroupAddon>
        </InputGroup>
    )
}

export default React.memo(InputSearch)
