import { useMemo } from 'react'; import { X } from 'lucide-react'; import { getIcon } from 'material-file-icons'; import type { OpenFile } from './useEditorState'; type EditorTabsProps = { files: OpenFile[]; activePath: string | null; onSelect: (path: string) => void; onClose: (path: string) => void; theme?: string; }; const FileIcon = ({ name }: { name: string }) => { const svg = useMemo(() => getIcon(name).svg, [name]); return ; }; export const EditorTabs = ({ files, activePath, onSelect, onClose, theme }: EditorTabsProps) => { if (files.length === 0) return null; const isDark = theme !== 'vs'; const borderColor = isDark ? '#333' : '#e0e0e0'; const activeBg = isDark ? '#1e1e1e' : '#ffffff'; const inactiveBg = isDark ? '#181818' : '#f3f3f3'; const activeColor = isDark ? '#ccc' : '#333'; const inactiveColor = isDark ? '#888' : '#666'; return (
{files.map((file) => { const isActive = file.path === activePath; return ( ); })}
); };