Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

773 B
Raw Blame
'use client';

import { LinearRender } from '@lobechat/shared-tool-ui/renders';
import type { BuiltinRender } from '@lobechat/types';

import {
  isLinearMcpApiName,
  LINEAR_MCP_PREFIX,
  LINEAR_MCP_TOOL_NAMES,
} from '../Inspector/linearMcpLabels';

const SharedLinearRender = LinearRender as unknown as BuiltinRender;

const FixedLinearMcpRenders: Record<string, BuiltinRender> = Object.fromEntries(
  LINEAR_MCP_TOOL_NAMES.map((tool) => [`${LINEAR_MCP_PREFIX}${tool}`, SharedLinearRender]),
);

export const LinearMcpRenders: Record<string, BuiltinRender> = new Proxy(FixedLinearMcpRenders, {
  get: (target, prop) => {
    if (typeof prop !== 'string') return undefined;
    return target[prop] || (isLinearMcpApiName(prop) ? SharedLinearRender : undefined);
  },
});