/** * @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; icon?: string; color?: string; marginBottom?: number; } export const InfoMessage: React.FC = ({ text, secondaryText, icon, color, marginBottom, }) => { color ??= theme.status.warning; const prefix = icon ?? 'ℹ '; const prefixWidth = prefix.length; return ( {prefix} {text.split('\n').map((line, index) => ( {index === text.split('\n').length - 1 && secondaryText && ( {secondaryText} )} ))} ); };