Download packages/cli/src/ui/components/messages/InfoMessage.tsx from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.42 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/components/messages/InfoMessage.tsx
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/components/messages/InfoMessage.tsx
-
curl -L -o InfoMessage.tsx https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/components/messages/InfoMessage.tsx
1.42 kB
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import type React from 'react'; | |
| import { Text, Box } from 'ink'; | |
| import { theme } from '../../semantic-colors.js'; | |
| import { RenderInline } from '../../utils/InlineMarkdownRenderer.js'; | |
| interface InfoMessageProps { | |
| text: string; | |
| secondaryText?: string; | |
| source?: string; | |
| icon?: string; | |
| color?: string; | |
| marginBottom?: number; | |
| } | |
| export const InfoMessage: React.FC<InfoMessageProps> = ({ | |
| text, | |
| secondaryText, | |
| source, | |
| icon, | |
| color, | |
| marginBottom, | |
| }) => { | |
| color ??= theme.status.warning; | |
| const prefix = icon ?? 'ℹ '; | |
| const prefixWidth = prefix.length; | |
| return ( | |
| <Box flexDirection="row" marginTop={1} marginBottom={marginBottom ?? 0}> | |
| <Box width={prefixWidth}> | |
| <Text color={color}>{prefix}</Text> | |
| </Box> | |
| <Box flexGrow={1} flexDirection="column"> | |
| {text.split('\n').map((line, index) => ( | |
| <Text wrap="wrap" key={index}> | |
| <RenderInline text={line} defaultColor={color} /> | |
| {index === text.split('\n').length - 1 && secondaryText && ( | |
| <Text color={theme.text.secondary}> {secondaryText}</Text> | |
| )} | |
| {index === text.split('\n').length - 1 && source && ( | |
| <Text color={theme.text.secondary}> [{source}]</Text> | |
| )} | |
| </Text> | |
| ))} | |
| </Box> | |
| </Box> | |
| ); | |
| }; | |