/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { Box, Text } from 'ink'; import { useOverflowState } from '../contexts/OverflowContext.js'; import { useStreamingContext } from '../contexts/StreamingContext.js'; import { StreamingState } from '../types.js'; import { theme } from '../semantic-colors.js'; interface ShowMoreLinesProps { constrainHeight: boolean; isOverflowing?: boolean; } export const ShowMoreLines = ({ constrainHeight, isOverflowing: isOverflowingProp, }: ShowMoreLinesProps) => { const overflowState = useOverflowState(); const streamingState = useStreamingContext(); const isOverflowing = isOverflowingProp ?? (overflowState !== undefined && overflowState.overflowingIds.size > 0); if ( !isOverflowing || !constrainHeight || !( streamingState === StreamingState.Idle || streamingState === StreamingState.WaitingForConfirmation || streamingState === StreamingState.Responding ) ) { return null; } return ( Press Ctrl+O to show more lines ); };