MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / getItemColor

Function getItemColor

web/src/components/layout/SiderBar.js:241–263  ·  view source on GitHub ↗
(itemKey)

Source from the content-addressed store, hash-verified

239
240 // 获取菜单项对应的颜色
241 const getItemColor = (itemKey) => {
242 switch (itemKey) {
243 case 'detail': return sidebarIconColors.dashboard;
244 case 'playground': return sidebarIconColors.terminal;
245 case 'chat': return sidebarIconColors.message;
246 case 'token': return sidebarIconColors.key;
247 case 'log': return sidebarIconColors.chart;
248 case 'usage-statistics': return sidebarIconColors.barChart;
249 case 'usage-statistics-monthly': return sidebarIconColors.barChart;
250 case 'midjourney': return sidebarIconColors.image;
251 case 'task': return sidebarIconColors.check;
252 case 'topup': return sidebarIconColors.credit;
253 case 'channel': return sidebarIconColors.layers;
254 case 'redemption': return sidebarIconColors.gift;
255 case 'user':
256 case 'personal': return sidebarIconColors.user;
257 case 'setting': return sidebarIconColors.settings;
258 default:
259 // 处理聊天项
260 if (itemKey && itemKey.startsWith('chat')) return sidebarIconColors.message;
261 return 'currentColor';
262 }
263 };
264
265 // 渲染自定义菜单项
266 const renderNavItem = (item) => {

Callers 2

renderNavItemFunction · 0.85
SiderBar.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected