// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { RaiseHandButton } from "../../../../../../react-components/src";
import React, { useMemo } from 'react';
import { usePropsFor } from '../../hooks/usePropsFor';
import { concatButtonBaseStyles } from '../../styles/Buttons.styles';
import { useSelector } from '../../hooks/useSelector';
import { getCallStatus } from '../../selectors/baseSelectors';
import { _isInLobbyOrConnecting } from "../../../../../../calling-component-bindings/src";
/** @private */
export const RaiseHand = (props) => {
    const raiseHandButtonProps = usePropsFor(RaiseHandButton);
    const callStatus = useSelector(getCallStatus);
    const styles = useMemo(() => { var _a; return concatButtonBaseStyles((_a = props.styles) !== null && _a !== void 0 ? _a : {}); }, [props.styles]);
    let raiseHandButtonDisabled = isDisabled(props.option);
    if (_isInLobbyOrConnecting(callStatus)) {
        raiseHandButtonDisabled = true;
    }
    return React.createElement(RaiseHandButton, Object.assign({ "data-ui-id": "call-composite-raisehand-button" }, raiseHandButtonProps, { showLabel: props.displayType !== 'compact', disabled: raiseHandButtonDisabled || props.disabled, styles: styles }));
};
const isDisabled = (option) => {
    if (option === undefined || option === true || option === false) {
        return false;
    }
    return option.disabled;
};
//# sourceMappingURL=RaiseHand.js.map