python/packages/autogen-studio/frontend/src/components/shared/README.md
The AddComponentDropdown component is a reusable dropdown that allows users to add components to a gallery. It supports all component types (teams, agents, models, tools, workbenches, terminations).
import { AddComponentDropdown } from "../../shared";
<AddComponentDropdown
componentType="workbench"
gallery={selectedGallery}
onComponentAdded={handleComponentAdded}
/>;
<AddComponentDropdown
componentType="workbench"
gallery={selectedGallery}
onComponentAdded={handleComponentAdded}
size="small"
type="text"
buttonText="+"
showChevron={false}
templateFilter={(template) =>
template.label.toLowerCase().includes("mcp") ||
template.description.toLowerCase().includes("mcp")
}
/>
componentType: The type of component to add (team, agent, model, tool, workbench, termination)gallery: The gallery to add the component toonComponentAdded: Callback when a component is addeddisabled: Whether the dropdown is disabledshowIcon: Whether to show the plus iconshowChevron: Whether to show the chevron down iconsize: Button sizetype: Button typeclassName: Additional CSS classesbuttonText: Custom button texttemplateFilter: Optional filter function for templatesconst handleComponentAdded = (
component: Component<ComponentConfig>,
category: CategoryKey
) => {
// Handle the added component
// Update your gallery/state here
};