2025-04-18 17:44:24 -07:00
|
|
|
|
/**
|
|
|
|
|
|
* @license
|
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2025-04-15 21:41:08 -07:00
|
|
|
|
import React from 'react';
|
|
|
|
|
|
import { Text, Box } from 'ink';
|
2025-08-15 15:39:54 -07:00
|
|
|
|
import { theme } from '../../semantic-colors.js';
|
2025-04-15 21:41:08 -07:00
|
|
|
|
|
|
|
|
|
|
interface InfoMessageProps {
|
2025-04-17 18:06:21 -04:00
|
|
|
|
text: string;
|
2025-04-15 21:41:08 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-18 19:09:41 -04:00
|
|
|
|
export const InfoMessage: React.FC<InfoMessageProps> = ({ text }) => {
|
2025-04-17 18:06:21 -04:00
|
|
|
|
const prefix = 'ℹ ';
|
|
|
|
|
|
const prefixWidth = prefix.length;
|
2025-04-15 21:41:08 -07:00
|
|
|
|
|
2025-04-17 18:06:21 -04:00
|
|
|
|
return (
|
2025-05-09 22:47:18 -07:00
|
|
|
|
<Box flexDirection="row" marginTop={1}>
|
2025-04-17 18:06:21 -04:00
|
|
|
|
<Box width={prefixWidth}>
|
2025-08-15 15:39:54 -07:00
|
|
|
|
<Text color={theme.status.warning}>{prefix}</Text>
|
2025-04-17 18:06:21 -04:00
|
|
|
|
</Box>
|
|
|
|
|
|
<Box flexGrow={1}>
|
2025-08-15 15:39:54 -07:00
|
|
|
|
<Text wrap="wrap" color={theme.status.warning}>
|
2025-04-17 18:06:21 -04:00
|
|
|
|
{text}
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
</Box>
|
|
|
|
|
|
</Box>
|
|
|
|
|
|
);
|
2025-04-15 21:41:08 -07:00
|
|
|
|
};
|