"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module StatusBar
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectionInfoField = void 0;
const React = require("react");
const SelectionCount_1 = require("./SelectionCount");
const react_redux_1 = require("react-redux");
const UiFramework_1 = require("../UiFramework");
/**
 * SelectionInfo Status Field React component. This component is designed to be specified in a status bar definition.
 * It is used to display the number of items in a selection set.
 * This React component is Redux connected.
 * @note Use [[SelectionCountField]] to display custom selection count.
 * @public
 */
function SelectionInfoField(props) {
    const count = (0, react_redux_1.useSelector)((state) => {
        const frameworkState = state[UiFramework_1.UiFramework.frameworkStateKey];
        if (!frameworkState)
            return 0;
        return frameworkState.sessionState.numItemsSelected;
    });
    return (React.createElement(SelectionCount_1.SelectionCountField, { className: props.className, style: props.style, count: count }));
}
exports.SelectionInfoField = SelectionInfoField;
//# sourceMappingURL=SelectionInfo.js.map