import { X } from 'lucide-react'; import StandaloneShell from './StandaloneShell'; /** * Reusable login modal component for Claude and Cursor CLI authentication * * @param {Object} props * @param {boolean} props.isOpen - Whether the modal is visible * @param {Function} props.onClose - Callback when modal is closed * @param {'claude'|'cursor'} props.provider - Which CLI provider to authenticate with * @param {Object} props.project - Project object containing name and path information * @param {Function} props.onComplete - Callback when login process completes (receives exitCode) * @param {string} props.customCommand - Optional custom command to override defaults */ function LoginModal({ isOpen, onClose, provider = 'claude', project, onComplete, customCommand }) { if (!isOpen) return null; const getCommand = () => { if (customCommand) return customCommand; switch (provider) { case 'claude': return 'claude setup-token --dangerously-skip-permissions'; case 'cursor': return 'cursor-agent login'; default: return 'claude setup-token --dangerously-skip-permissions'; } }; const getTitle = () => { switch (provider) { case 'claude': return 'Claude CLI Login'; case 'cursor': return 'Cursor CLI Login'; default: return 'CLI Login'; } }; const handleComplete = (exitCode) => { if (onComplete) { onComplete(exitCode); } if (exitCode === 0) { onClose(); } }; return (

{getTitle()}

); } export default LoginModal;