);
};
interface IntegrationsGridProps {
targetPage?: string;
suppressDirectToLLM?: boolean;
}
const IntegrationsGrid: React.FC = ({ targetPage, suppressDirectToLLM = false }) => {
const hasTargetPage = (integration: Integration, targetPage: string): boolean => {
// Direct to LLM special cases
if (integration.title === "Direct to LLM") {
return targetPage === "generative-ui" || targetPage === "frontend-actions";
}
// AutoGen2 missing pages
if (integration.title === "AutoGen2") {
return targetPage !== "generative-ui" && targetPage !== "shared-state";
}
// Frameworks that don't have shared-state pages
if (targetPage === "shared-state") {
return !["LlamaIndex", "Mastra", "AutoGen2", "Agno"].includes(integration.title);
}
// All other frameworks have the standard pages
return true;
};
const getHref = (integration: Integration) => {
if (!targetPage) {
return integration.href;
}
// Special cases where certain frameworks have pages in different locations
if (integration.title === "Direct to LLM") {
if (targetPage === "generative-ui") {
return "/direct-to-llm/guides/generative-ui";
}
if (targetPage === "frontend-actions") {
return "/direct-to-llm/guides/frontend-actions";
}
}
// For other frameworks, append the target page
return `${integration.href}/${targetPage}`;
};
let filteredIntegrations = integrations;
// Hide Microsoft Agent Framework from the integrations grid
// TODO: Remove this once Microsoft Agent Framework support is announced
filteredIntegrations = filteredIntegrations.filter((integration) => {
return !integration.title.toLowerCase().includes("microsoft");
});
// Filter out Direct to LLM if suppressed
if (suppressDirectToLLM) {
filteredIntegrations = filteredIntegrations.filter(integration => integration.title !== "Direct to LLM");
}
// Filter out integrations that don't have the target page
if (targetPage) {
filteredIntegrations = filteredIntegrations.filter(integration => hasTargetPage(integration, targetPage));
}
return (