/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ import type React from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../colors.js'; import type { ConsoleMessageItem } from '../types.js'; import { MaxSizedBox } from './shared/MaxSizedBox.js'; import { getBorderStyle } from '../contexts/UnicodeRenderingContext.js'; interface DetailedMessagesDisplayProps { messages: ConsoleMessageItem[]; maxHeight: number | undefined; width: number; // debugMode is not needed here if App.tsx filters debug messages before passing them. // If DetailedMessagesDisplay should handle filtering, add debugMode prop. } export const DetailedMessagesDisplay: React.FC< DetailedMessagesDisplayProps > = ({ messages, maxHeight, width }) => { if (messages.length === 0) { return null; // Don't render anything if there are no messages } const borderAndPadding = 4; return ( Debug Console (ctrl+o to close) {messages.map((msg, index) => { let textColor = Colors.Foreground; let icon = 'INFO:'; // Information switch (msg.type) { case 'warn': textColor = Colors.AccentYellow; icon = 'WARNING:'; // Warning sign break; case 'error': textColor = Colors.AccentRed; icon = 'ERROR:'; // Error break; case 'debug': textColor = Colors.Gray; // Or Colors.Gray icon = 'DEBUG:'; // Debug break; case 'log': default: // Default textColor and icon are already set break; } return ( {icon} {msg.content} {msg.count > 1 && ( (x{msg.count}) )} ); })} ); };