Files
gemini-cli/packages/cli/src/ui/components/messages/ErrorMessage.tsx
T

32 lines
694 B
TypeScript
Raw Normal View History

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type React from 'react';
2025-04-15 21:41:08 -07:00
import { Text, Box } from 'ink';
2025-09-10 10:57:07 -07:00
import { theme } from '../../semantic-colors.js';
2025-04-15 21:41:08 -07:00
interface ErrorMessageProps {
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 ErrorMessage: React.FC<ErrorMessageProps> = ({ 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 (
<Box flexDirection="row" marginBottom={1}>
2025-04-17 18:06:21 -04:00
<Box width={prefixWidth}>
2025-09-10 10:57:07 -07:00
<Text color={theme.status.error}>{prefix}</Text>
2025-04-17 18:06:21 -04:00
</Box>
<Box flexGrow={1}>
2025-09-10 10:57:07 -07:00
<Text wrap="wrap" color={theme.status.error}>
2025-04-17 18:06:21 -04:00
{text}
</Text>
</Box>
</Box>
);
2025-04-15 21:41:08 -07:00
};