"use client" import Link from "next/link" import { cn } from "@/lib/utils" type AuthConnectButtonCommon = { children: React.ReactNode className?: string } type AuthConnectButtonAsButton = AuthConnectButtonCommon & React.ButtonHTMLAttributes & { href?: undefined } type AuthConnectButtonAsAnchor = AuthConnectButtonCommon & React.AnchorHTMLAttributes & { href: string } type AuthConnectButtonAsLink = AuthConnectButtonCommon & Omit, "href"> & { href: string as: "link" } export type AuthConnectButtonProps = | AuthConnectButtonAsButton | AuthConnectButtonAsAnchor | AuthConnectButtonAsLink /** UltiSpace gradient CTA — full width, centered in auth flows. */ export function AuthConnectButton(props: AuthConnectButtonProps) { const { children, className } = props const btnClass = cn("ultimail-login-connect-btn w-full", className) let control: React.ReactNode if ("as" in props && props.as === "link") { const { as: _as, href, className: _c, children: _ch, ...linkProps } = props control = ( {children} ) } else if ("href" in props && props.href) { const { href, className: _c, children: _ch, ...anchorProps } = props control = ( {children} ) } else { const { className: _c, children: _ch, ...buttonProps } = props control = ( ) } return (
{control}
) }