fix: link out

This commit is contained in:
Krrish Dholakia 2026-01-17 19:43:19 -08:00
parent 89113b7661
commit 2afcb258d0

View file

@ -48,6 +48,7 @@ interface MenuItem {
roles?: string[];
children?: MenuItem[];
icon?: React.ReactNode;
external_url?: string;
}
// Group configuration
@ -259,6 +260,7 @@ const Sidebar: React.FC<SidebarProps> = ({ setPage, defaultSelectedKey, collapse
page: "learning-resources",
label: "Learning Resources",
icon: <BookOutlined />,
external_url: "https://models.litellm.ai/cookbook",
},
],
},
@ -371,9 +373,23 @@ const Sidebar: React.FC<SidebarProps> = ({ setPage, defaultSelectedKey, collapse
key: child.key,
icon: child.icon,
label: child.label,
onClick: () => navigateToPage(child.page),
onClick: () => {
if (child.external_url) {
window.open(child.external_url, "_blank");
} else {
navigateToPage(child.page);
}
},
})),
onClick: !item.children ? () => navigateToPage(item.page) : undefined,
onClick: !item.children
? () => {
if (item.external_url) {
window.open(item.external_url, "_blank");
} else {
navigateToPage(item.page);
}
}
: undefined,
})),
});
});