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

Function renderModelTag

web/src/helpers/render.js:549–570  ·  view source on GitHub ↗
(modelName, options = {})

Source from the content-addressed store, hash-verified

547
548// 渲染带有模型图标的标签
549export function renderModelTag(modelName, options = {}) {
550 const {
551 color,
552 size = 'default',
553 shape = 'circle',
554 onClick,
555 suffixIcon,
556 } = options;
557
558 const categories = getModelCategories(i18next.t);
559 let icon = null;
560
561 for (const [key, category] of Object.entries(categories)) {
562 if (key !== 'all' && category.filter({ model_name: modelName })) {
563 icon = category.icon;
564 break;
565 }
566 }
567
568 return (
569 <Tag
570 color={color || stringToColor(modelName)}
571 prefixIcon={icon}
572 suffixIcon={suffixIcon}
573 size={size}

Callers 3

LogsTable.jsFile · 0.90
ModelPricing.jsFile · 0.90
PersonalSetting.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected