/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../colors.js'; import { themeManager } from '../themes/theme-manager.js'; import { RadioButtonSelect } from './shared/RadioButtonSelect.js'; import { DiffRenderer } from './messages/DiffRenderer.js'; import { colorizeCode } from '../utils/CodeColorizer.js'; interface ThemeDialogProps { /** Callback function when a theme is selected */ onSelect: (themeName: string) => void; /** Callback function when a theme is highlighted */ onHighlight: (themeName: string) => void; } export function ThemeDialog({ onSelect, onHighlight, }: ThemeDialogProps): React.JSX.Element { const themeItems = themeManager.getAvailableThemes().map((theme) => ({ label: theme.active ? `${theme.name} (Active)` : theme.name, value: theme.name, })); const initialIndex = themeItems.findIndex( (item) => item.value === themeManager.getActiveTheme().name, ); return ( Select Theme (Use ↑/↓ arrows and Enter to select) Preview {colorizeCode( `# Source code print("Hello, World!") `, 'python', )} ); }