"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExampleSearch = void 0;
const react_1 = __importDefault(require("react"));
const ExampleSearch = (props) => {
    const handleFormSubmit = react_1.default.useCallback((event) => {
        event.preventDefault();
        props.submitSearchTerm();
    }, [props.submitSearchTerm]);
    const handleInputChange = react_1.default.useCallback((event) => {
        props.setSearchTerm(event.target.value);
    }, [props.setSearchTerm]);
    return (react_1.default.createElement("form", { onSubmit: handleFormSubmit },
        react_1.default.createElement("input", { type: "search", placeholder: "Search products...", value: props.searchTerm, onChange: handleInputChange })));
};
exports.ExampleSearch = ExampleSearch;
//# sourceMappingURL=ExampleSearch.js.map