import type { CSSProperties } from "react"; import { appPath } from "./api-path.js"; import { cn } from "./utils.js"; export interface PoweredByBadgeProps { position?: "bottom-right" | "bottom-left"; /** Plain shows the logo only with no surrounding badge chrome. */ variant?: "badge" | "plain"; /** When true, positioning is handled by the parent container. */ embedded?: boolean; } export interface OpenSourceBadgeProps { position?: "bottom-left" | "bottom-right"; /** When true, positioning is handled by the parent container. */ embedded?: boolean; } const containerStyle = ( position: "bottom-right" | "bottom-left", ): CSSProperties => ({ position: "fixed", bottom: 16, ...(position === "bottom-right" ? { right: 16 } : { left: 16 }), zIndex: 50, display: "flex", alignItems: "center", gap: 6, padding: "6px 12px", borderRadius: 8, fontSize: 12, fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', fontWeight: 500, lineHeight: 1, color: "rgba(95, 95, 95, 0.95)", background: "rgba(0, 0, 0, 0.05)", backdropFilter: "blur(8px)", WebkitBackdropFilter: "blur(8px)", border: "1px solid rgba(0, 0, 0, 0.06)", textDecoration: "none", transition: "opacity 0.2s, color 0.2s", opacity: 0.82, }); const darkQuery = "(prefers-color-scheme: dark)"; /** * Small branding badge: "Built with [Agent Native logo]" * * - Fixed position in the corner * - Subtle, semi-transparent * - Links to https://agent-native.com * - Respects prefers-color-scheme * - Can be hidden via HIDE_BRANDING=true env var (for white-label) */ export function PoweredByBadge({ position = "bottom-right", variant = "badge", embedded = false, }: PoweredByBadgeProps) { // Allow hiding via env var const hidden = (import.meta.env as Record) ?.VITE_HIDE_BRANDING === "true"; if (hidden) return null; const logoOnLight = appPath("/agent-native-logo-light.svg"); const logoOnDark = appPath("/agent-native-logo-dark.svg"); const isPlain = variant === "plain"; return ( <> {!isPlain && Built with} Agent Native Agent Native ); } /** * Small badge: "Free and open source" * * Intended to pair with PoweredByBadge on public pages. */ export function OpenSourceBadge({ position = "bottom-left", embedded = false, }: OpenSourceBadgeProps) { const hidden = (import.meta.env as Record) ?.VITE_HIDE_BRANDING === "true"; if (hidden) return null; return ( <> Free and open source ); }