🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
import { Block, cssVar, Highlighter, Tag } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import InlineTable from '@/components/InlineTable';
import { useDetailContext } from '../DetailProvider';
import { SchemaEmpty } from './SchemaList';
import { styles } from './style';
import { ModeType } from './types';
const Resources = memo<{ mode?: ModeType }>(({ mode }) => {
const { t } = useTranslation(['discover', 'plugin']);
const { resources } = useDetailContext();
if (!resources?.length) return <SchemaEmpty>{t('plugin:mcpEmpty.resources')}</SchemaEmpty>;
return mode === ModeType.Docs ? (
<Block style={{ overflow: 'hidden' }} variant={'outlined'}>
<InlineTable
dataSource={resources}
pagination={false}
rowKey={'uri'}
size={'middle'}
columns={[
{
dataIndex: 'name',
key: 'name',
render: (text) => (
<span className={styles.code} style={{ color: cssVar.gold }}>
{text}
</span>
),
title: t('mcp.details.schema.resources.table.name'),
},
{
dataIndex: 'mimeType',
key: 'mimeType',
render: (_, record) => <Tag className={styles.code}>{record.mimeType}</Tag>,
title: t('mcp.details.schema.resources.table.mineType'),
},
{
dataIndex: 'uri',
key: 'uri',
title: t('mcp.details.schema.resources.table.uri'),
},
{
key: 'description',
render: (_, record) => (record as { description?: string }).description,
title: t('mcp.details.schema.resources.table.description'),
},
]}
/>
</Block>
) : (
<Highlighter language={'json'} style={{ fontSize: 12 }} variant={'outlined'}>
{JSON.stringify(resources, null, 2)}
</Highlighter>
);
});
export default Resources;