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