diff options
| author | Jacob Richman <[email protected]> | 2025-06-22 00:54:10 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-22 00:54:10 +0000 |
| commit | 63f6a497cba61299a1c24aa96795a55479740ac6 (patch) | |
| tree | 34781289e6296340e7cf76300413b06f8994c1ab /packages/cli/src/ui/components/ShowMoreLines.tsx | |
| parent | e20171e7ddb7c4d0935dcb578b8395dc560005ec (diff) | |
Jacob314/overflow notification and one MaxSizedBox bug fix (#1288)
Diffstat (limited to 'packages/cli/src/ui/components/ShowMoreLines.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/ShowMoreLines.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/cli/src/ui/components/ShowMoreLines.tsx b/packages/cli/src/ui/components/ShowMoreLines.tsx new file mode 100644 index 00000000..bfcefcbf --- /dev/null +++ b/packages/cli/src/ui/components/ShowMoreLines.tsx @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { Box, Text } from 'ink'; +import { useOverflowState } from '../contexts/OverflowContext.js'; +import { Colors } from '../colors.js'; + +interface ShowMoreLinesProps { + constrainHeight: boolean; +} + +export const ShowMoreLines = ({ constrainHeight }: ShowMoreLinesProps) => { + const overflowState = useOverflowState(); + + if ( + overflowState === undefined || + overflowState.overflowingIds.size === 0 || + !constrainHeight + ) { + return null; + } + + return ( + <Box> + <Text color={Colors.Gray} wrap="truncate"> + Press Ctrl-S to show more lines + </Text> + </Box> + ); +}; |
