import React from "react";
import { useSelector } from "react-redux";
import { Button } from "@netdata/netdata-ui";
import SignInButton from "../../auth/signIn";
import SignInIframe from "../../auth/signIn/iframe";
import useCheckSignInStatus from "../../auth/signIn/useCheckSignInStatus";
import { selectIsCloudEnabled } from "../../../domains/global/selectors";
import Tooltip from "../../tooltips";
const SignIn = () => {
    const [signedIn] = useCheckSignInStatus();
    const cloudEnabled = useSelector(selectIsCloudEnabled);
    return (cloudEnabled && (React.createElement(Tooltip, { content: "Sign in to Netdata to monitor all your nodes at once, have composite charts, custom dashboards, use intelligent features and more", align: "bottom", plain: true },
        React.createElement("div", null,
            React.createElement(SignInIframe, { signedIn: signedIn }),
            !signedIn && (React.createElement(SignInButton, { utmParameters: { content: "topbar" } }, ({ isRegistry, link, offline, onSignIn }) => (React.createElement(Button, Object.assign({ "data-testid": "header-signin", label: "Sign in", disabled: offline }, (isRegistry ? { as: "a", href: link } : { onClick: onSignIn }))))))))));
};
export default SignIn;
//# sourceMappingURL=index.js.map