summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/ShowMoreLines.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/components/ShowMoreLines.tsx')
-rw-r--r--packages/cli/src/ui/components/ShowMoreLines.tsx33
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>
+ );
+};