/** * Terminal Connection Progress * Displays connection progress with logs and timeout */ import { Loader2, Play } from 'lucide-react'; import React from 'react'; import { useI18n } from '../../application/i18n/I18nProvider'; import { Button } from '../ui/button'; import { ScrollArea } from '../ui/scroll-area'; export interface TerminalConnectionProgressProps { status: 'connecting' | 'connected' | 'disconnected'; error: string | null; timeLeft: number; isCancelling: boolean; showLogs: boolean; progressLogs: string[]; onCancelConnect: () => void; onCloseSession: () => void; onRetry: () => void; } export interface TerminalConnectionLogListProps { progressLogs: string[]; error?: string | null; } export const TerminalConnectionLogList: React.FC = ({ progressLogs, error, }) => (
{progressLogs.map((line, idx) => (
{line}
))} {error && (
{error}
)}
); export const TerminalConnectionProgress: React.FC = ({ status, error, timeLeft, isCancelling: _isCancelling, showLogs, progressLogs, onCancelConnect: _onCancelConnect, onCloseSession, onRetry, }) => { const { t } = useI18n(); return ( <>
{status === 'connecting' ? ( <> {t('terminal.progress.timeoutIn', { seconds: timeLeft })} ) : ( <>
{error || t('terminal.progress.disconnected')} )}
{showLogs && ( )}
{status !== 'connecting' && ( <> )}
); }; export default TerminalConnectionProgress;