"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SensorSort = void 0;
const react_1 = __importDefault(require("react"));
const ReactiveComponent_1 = __importDefault(require("@usereactify/search-internals/lib/components/basic/ReactiveComponent"));
const hooks_1 = require("../../hooks");
const props_1 = require("../../utility/props");
const SensorSort = () => {
    const flagsHook = (0, hooks_1.useFlags)();
    const reactifySearchContext = (0, hooks_1.useReactifySearchContext)();
    const { sortOption } = (0, hooks_1.useSortBy)();
    const { searchTerm } = (0, hooks_1.useSearch)();
    const reactiveProps = (0, props_1.getPropsSensorSort)({
        config: reactifySearchContext.config,
        provider: reactifySearchContext.options,
        sortOption: sortOption === null || sortOption === void 0 ? void 0 : sortOption.handle,
        searchTerm: searchTerm,
    });
    if (!flagsHook.flags["reactify-search:flag_sensor_sort"]) {
        return null;
    }
    return (react_1.default.createElement(ReactiveComponent_1.default, Object.assign({}, reactiveProps)));
};
exports.SensorSort = SensorSort;
//# sourceMappingURL=SensorSort.js.map