"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickSearchDrawer = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_redux_1 = require("react-redux");
const Flex_1 = require("../../../components/Flex");
const index_1 = require("../../../components/Drawer/index");
const InternalRedux_1 = require("../../../Redux/ActionsReducers/InternalRedux");
const AdaptableContext_1 = require("../../AdaptableContext");
const QuickSearchInput_1 = require("../QuickSearchInput");
const QuickSearchDrawer = () => {
    const adaptable = (0, AdaptableContext_1.useAdaptable)();
    const isOpen = (0, react_redux_1.useSelector)((state) => (0, InternalRedux_1.QuickSearchFloatingVisibilitySelector)(state.Internal));
    return (React.createElement(index_1.Drawer, { open: isOpen, onOpenChange: (open) => {
            if (open) {
                adaptable.api.quickSearchApi.showFloatingQuickSearch();
            }
            else {
                adaptable.api.quickSearchApi.hideFloatingQuickSearch();
            }
        } },
        React.createElement(Flex_1.Flex, { className: "ab-FloatinQuickSearch ab-FloatingQuickSearch" },
            React.createElement(QuickSearchInput_1.QuickSearchInput, { autoFocus: true }))));
};
exports.QuickSearchDrawer = QuickSearchDrawer;
