/*---------------------------------------------------------------------------------------------
* 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
 */
import "./PromptField.scss";
import classnames from "classnames";
import * as React from "react";
import { connect } from "react-redux";
import { FooterIndicator } from "@itwin/appui-layout-react";
import { UiFramework } from "../UiFramework";
/**
 * Prompt Field React component. This component is designed to be specified in a status bar definition.
 * It is used to display prompts from tools. To send a prompt to this component use IModelApp.notifications.outputPromptByKey or
 * IModelApp.notifications.outputPrompt.
 */
class PromptFieldComponent extends React.Component {
    constructor(props) {
        super(props);
    }
    render() {
        var _a;
        return (React.createElement(FooterIndicator // eslint-disable-line deprecation/deprecation
        , { className: classnames("uifw-statusFields-promptField", this.props.className), style: this.props.style, 
            // eslint-disable-next-line deprecation/deprecation
            isInFooterMode: (_a = this.props.isInFooterMode) !== null && _a !== void 0 ? _a : true }, this.props.toolPrompt));
    }
}
/** Function used by Redux to map state data in Redux store to props that are used to render this component. */
function mapStateToProps(state) {
    const frameworkState = state[UiFramework.frameworkStateKey]; // since app sets up key, don't hard-code name
    /* istanbul ignore next */
    if (!frameworkState)
        return undefined;
    return { toolPrompt: frameworkState.configurableUiState.toolPrompt };
}
// we declare the variable and export that rather than using export default.
/**
 * Prompt Field React component. This component is designed to be specified in a status bar definition.
 * It is used to display prompts from tools. To send a prompt to this component use IModelApp.notifications.outputPromptByKey or
 * IModelApp.notifications.outputPrompt.
 * This React component is Redux connected.
 * @public
 * @deprecated in 1.x Use ToolAssistanceField instead
 */ // eslint-disable-next-line @typescript-eslint/naming-convention
export const PromptField = connect(mapStateToProps)(PromptFieldComponent);
//# sourceMappingURL=PromptField.js.map