2025-04-15 21:41:08 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
import { Text, Box } from 'ink';
|
|
|
|
|
|
|
|
|
|
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">
|
|
|
|
|
<Box width={prefixWidth}>
|
|
|
|
|
<Text color="red">{prefix}</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box flexGrow={1}>
|
|
|
|
|
<Text wrap="wrap" color="red">
|
|
|
|
|
{text}
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
2025-04-15 21:41:08 -07:00
|
|
|
};
|