2025-09-17 14:32:46 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import type React from 'react';
|
|
|
|
|
import { Box, Text } from 'ink';
|
2025-11-02 19:21:26 -05:00
|
|
|
import { theme } from '../../semantic-colors.js';
|
2025-09-17 14:32:46 -07:00
|
|
|
import { RenderInline } from '../../utils/InlineMarkdownRenderer.js';
|
|
|
|
|
|
|
|
|
|
interface WarningMessageProps {
|
|
|
|
|
text: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const WarningMessage: React.FC<WarningMessageProps> = ({ text }) => {
|
|
|
|
|
const prefix = '⚠ ';
|
|
|
|
|
const prefixWidth = 3;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Box flexDirection="row" marginTop={1}>
|
|
|
|
|
<Box width={prefixWidth}>
|
2025-11-02 19:21:26 -05:00
|
|
|
<Text color={theme.status.warning}>{prefix}</Text>
|
2025-09-17 14:32:46 -07:00
|
|
|
</Box>
|
|
|
|
|
<Box flexGrow={1}>
|
2025-11-02 19:21:26 -05:00
|
|
|
<Text wrap="wrap">
|
|
|
|
|
<RenderInline text={text} defaultColor={theme.status.warning} />
|
2025-09-17 14:32:46 -07:00
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|