/**
 * SSOPanel — OIDC or mTLS auth panels
 *
 * Props:
 *   mode — 'oidc' | 'mtls'
 *   base — base path
 */
const { html } = window;

export function SSOPanel({ mode, base = '' }) {
    if (mode === 'oidc') {
        return html`
            <div class="login-anim login-anim-a2">
                <p class="login-sso-desc">
                    This instance uses Single Sign-On. Click below to
                    authenticate with your identity provider.
                </p>
                <a class="login-btn login-btn--link"
                   href="${base}/api/v1/auth/oidc/login">
                    Sign in with SSO
                </a>
            </div>
        `;
    }

    if (mode === 'mtls') {
        return html`
            <div class="login-anim login-anim-a2">
                <p class="login-sso-desc">
                    This instance uses client certificate authentication.
                    Ensure your browser has a valid certificate installed.
                </p>
                <a class="login-btn login-btn--link" href="${base}/">
                    Continue with Certificate
                </a>
            </div>
        `;
    }

    return null;
}
