// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { CameraButton } from "../../../../../../react-components/src";
import { _HighContrastAwareIcon } 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 { getCapabilites, getIsRoomsCall, getRole } from '../../selectors/baseSelectors';
/**
 * @private
 */
export const Camera = (props) => {
    var _a;
    const cameraButtonProps = usePropsFor(CameraButton);
    const styles = useMemo(() => { var _a; return concatButtonBaseStyles((_a = props.styles) !== null && _a !== void 0 ? _a : {}); }, [props.styles]);
    const isRoomsCall = useSelector(getIsRoomsCall);
    const role = useSelector(getRole);
    const turnVideoOnCapability = (_a = useSelector(getCapabilites)) === null || _a === void 0 ? void 0 : _a.turnVideoOn;
    return React.createElement(CameraButton, Object.assign({ "data-ui-id": "call-composite-camera-button" }, cameraButtonProps, { showLabel: props.displayType !== 'compact', styles: styles, enableDeviceSelectionMenu: props.splitButtonsForDeviceSelection, disableTooltip: props.disableTooltip, disabled: cameraButtonProps.disabled || props.disabled || !!(isRoomsCall && role === 'Unknown'), onRenderOffIcon: turnVideoOnCapability && !turnVideoOnCapability.isPresent ? () => React.createElement(_HighContrastAwareIcon, { disabled: true, iconName: 'ControlButtonCameraProhibited' }) : undefined, onClickVideoEffects: props.onClickVideoEffects, componentRef: props.componentRef }));
};
//# sourceMappingURL=Camera.js.map