fix(c8): shared TeamPanel component (arch-062) + curated icon map in SortableMenuItem (arch-063 OOM fix)

This commit is contained in:
Agent Zero
2026-08-23 23:44:43 +02:00
parent cad7d084e8
commit b8b8ef180a
4 changed files with 151 additions and 122 deletions
@@ -1,10 +1,61 @@
import React from 'react';
import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import { GripVertical, FolderOpen } from 'lucide-react';
import * as LucideIcons from 'lucide-react';
import {
Activity,
ArrowUpDown,
BarChart3,
Bell,
BookOpen,
Bot,
Calendar,
CheckSquare,
Copy,
FileText,
FolderOpen,
Link as LinkIcon,
Mail,
MessageSquare,
Settings,
Shield,
Sparkles,
Tag,
GripVertical,
Trash2,
Users,
UsersRound,
Workflow,
} from 'lucide-react';
import clsx from 'clsx';
// Curated icon map — avoids `import * as LucideIcons` which loads ALL icons
// and causes OOM in tests (ARCH-063).
const ICON_MAP: Record<string, React.ComponentType<{ className?: string }>> = {
Activity,
ArrowUpDown,
BarChart: BarChart3,
BarChart3,
Bell,
BookOpen,
Bot,
Calendar,
CheckSquare,
Copy,
FolderOpen,
Link: LinkIcon,
Mail,
MessageSquare,
Settings,
Shield,
Sparkles,
Tag,
Trash: Trash2,
Trash2,
Users,
UsersRound,
Workflow,
};
interface SortableMenuItemProps {
id: string;
label: string;
@@ -13,8 +64,8 @@ interface SortableMenuItemProps {
}
function getIcon(name: string): React.ReactNode {
const Icon = (LucideIcons as any)[name];
return Icon ? <Icon className="h-4 w-4" /> : <LucideIcons.FileText className="h-4 w-4" />;
const Icon = ICON_MAP[name];
return Icon ? <Icon className="h-4 w-4" /> : <FileText className="h-4 w-4" />;
}
export function SortableMenuItem({ id, label, icon, isGroup }: SortableMenuItemProps) {