import React, { useMemo, useState } from 'react';
import { TERMINAL_THEMES } from '../infrastructure/config/terminalThemes';
import { useCustomThemes } from '../application/state/customThemeStore';
import { cn } from '../lib/utils';
import { TerminalTheme } from '../types';
import {
AsidePanel,
AsidePanelContent,
} from './ui/aside-panel';
import { ScrollArea } from './ui/scroll-area';
interface ThemeSelectPanelProps {
open: boolean;
selectedThemeId?: string;
onSelect: (themeId: string) => void;
onClose: () => void;
onBack?: () => void;
showBackButton?: boolean;
}
// Mini terminal preview component
const TerminalPreview: React.FC<{ theme: TerminalTheme; isSelected: boolean }> = ({
theme,
isSelected
}) => {
return (
${' '}
ls
dir/
file
${' '}
);
};
const ThemeSelectPanel: React.FC = ({
open,
selectedThemeId,
onSelect,
onClose,
onBack,
showBackButton = true,
}) => {
// Reserved for future hover preview feature
const [_hoveredThemeId, setHoveredThemeId] = useState(null);
const customThemes = useCustomThemes();
// All themes combined
const allThemes = useMemo(() => {
return [...TERMINAL_THEMES, ...customThemes];
}, [customThemes]);
const renderThemeItem = (theme: TerminalTheme) => {
const isSelected = theme.id === selectedThemeId;
return (
);
};
return (
{/* All themes in a single list */}
{allThemes.map(renderThemeItem)}
);
};
export default ThemeSelectPanel;