import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { OAuthProvider, signInWithRedirect } from "firebase/auth";
import { getFirebaseAuth } from "@vertesia/ui/session";
import { Button } from "@vertesia/ui/core";
export default function MicrosoftSignInButton({ redirectTo }) {
    const signIn = () => {
        localStorage.removeItem("tenantName");
        let redirectPath = redirectTo || window.location.pathname || '/';
        if (redirectPath[0] !== '/') {
            redirectPath = '/' + redirectPath;
        }
        const provider = new OAuthProvider('microsoft.com');
        provider.addScope('profile');
        provider.addScope('email');
        signInWithRedirect(getFirebaseAuth(), provider);
    };
    return (_jsxs(Button, { variant: "outline", onClick: signIn, className: "w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center", children: [_jsx("img", { className: "size-6", src: "https://learn.microsoft.com/en-us/entra/identity-platform/media/howto-add-branding-in-apps/ms-symbollockup_mssymbol_19.svg", loading: "lazy", alt: "microsoft logo" }), _jsx("span", { className: "text-sm font-semibold", children: "Continue with Microsoft" })] }));
}
//# sourceMappingURL=MicrosoftSigninButton.js.map