/** * Component: API Docs Token Input * Documentation: documentation/backend/services/api-tokens.md * * Token input field with toggle between custom API token and current session auth. */ 'use client'; import { useState } from 'react'; interface TokenInputProps { token: string; onTokenChange: (token: string) => void; useSession: boolean; onUseSessionChange: (useSession: boolean) => void; } export function TokenInput({ token, onTokenChange, useSession, onUseSessionChange, }: TokenInputProps) { const [showToken, setShowToken] = useState(false); return (

Authentication

Choose how to authenticate your test requests

{/* Session toggle */}
{useSession ? (
Using your current browser session for authentication
) : (
onTokenChange(e.target.value)} placeholder="rmab_your_api_token_here" className="w-full rounded-xl border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-900/50 px-4 py-2.5 pr-20 text-sm font-mono text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 focus:outline-none transition-all" />
)}
); }