"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExampleHookUseSortBy = void 0;
const react_1 = __importDefault(require("react"));
const hooks_1 = require("../../hooks");
const ExampleHookUseSortBy = () => {
    var _a;
    const sortByHook = (0, hooks_1.useSortBy)();
    const handleSelectChange = react_1.default.useCallback((event) => {
        sortByHook.setSortOption(event.target.value);
    }, [sortByHook.setSortOption]);
    return (react_1.default.createElement("select", { value: (_a = sortByHook.sortOption) === null || _a === void 0 ? void 0 : _a.handle, onChange: handleSelectChange }, sortByHook.sortOptions.map((sortOption) => (react_1.default.createElement("option", { key: sortOption.handle, value: sortOption.handle }, sortOption.name)))));
};
exports.ExampleHookUseSortBy = ExampleHookUseSortBy;
//# sourceMappingURL=ExampleHookUseSortBy.js.map