import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { Button } from "antd";
import { useAppState } from "../overmind";
export const UnsidAuth = ({ children, redirectPath, redirectUrl }) => {
    const state = useAppState();
    const hostname = state.config.settings.app.currentHost;
    const params = {
        requestor: state.config.settings.newcoin.daoDomain,
        referer: hostname,
        redirectUrl: redirectUrl || redirectPath || `https://${hostname}`,
    };
    const unsidUrl = `https://auth-dev.unsid.org/explore?requestor=${params.requestor}&referer=${params.referer}&redirectUrl=${params.redirectUrl}`;
    return (_jsx(_Fragment, { children: children || (_jsxs(_Fragment, { children: [_jsx("h1", { className: "text-center", children: `Welcome to ${state.config.settings.app.name}` }), _jsx("h2", { className: "text-center", children: "This is a unsid-enabled service." }), _jsx("h2", { className: "text-center", children: "Please sign in using your account at auth.unsid.org" }), _jsx("div", { className: "text-center", children: _jsx(Button, { style: { fontSize: 30, height: 60, marginTop: 60 }, onClick: () => (window.location = unsidUrl), children: "Sign In" }) })] })) }));
};
//# sourceMappingURL=UnsidAuth.js.map