import React from "react";
export default class SearchBox extends React.Component {
    constructor(props) {
        super(props);
        this.textInput = React.createRef();
        this.focus = this.focus.bind(this);
    }
    focus() {
        var _a, _b;
        (_b = (_a = this.textInput) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.focus();
    }
    render() {
        return (React.createElement("div", { className: "search-box" },
            React.createElement("i", { className: "ff-search" }),
            React.createElement("input", { required: true, className: "input-box", ref: this.textInput, value: this.props.searchString, type: "text", placeholder: "Search", onChange: (e) => {
                    this.props.updateSearchString(e.target.value);
                } }),
            React.createElement("button", { className: "close-icon", onClick: () => {
                    this.props.updateSearchString("");
                    this.focus();
                }, type: "reset" })));
    }
}
//# sourceMappingURL=SearchBox.js.map