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";
const SignIn = () => {
    const [signedIn] = useCheckSignInStatus();
    const cloudEnabled = useSelector(selectIsCloudEnabled);
    return (cloudEnabled && (React.createElement(React.Fragment, null,
        React.createElement(SignInIframe, { signedIn: signedIn }),
        !signedIn && (React.createElement(SignInButton, null, ({ isRegistry, link, hasSignedInBefore, offline, onSignIn }) => (React.createElement(Button, Object.assign({ label: hasSignedInBefore ? "SIGN IN TO CLOUD" : "SIGN UP TO CLOUD", disabled: offline }, (isRegistry ? { as: "a", href: link } : { onClick: onSignIn })))))))));
};
export default SignIn;
//# sourceMappingURL=index.js.map