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.

🐛 fix: skill detail page icon problem (#11912)

Rdmclin291155fd379bc
diff --git a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx
index 4c9ad897212..421cec694dd 100644
--- a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx
+++ b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx
@@ -3,7 +3,7 @@
import { type KlavisServerType } from '@lobechat/const';
import { Avatar, DropdownMenu, Flexbox, Icon, Button as LobeButton } from '@lobehub/ui';
import { App, Button } from 'antd';
-import { createStaticStyles, cssVar } from 'antd-style';
+import { cssVar } from 'antd-style';
import { Loader2, MoreHorizontalIcon, SquareArrowOutUpRight, Unplug } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -14,54 +14,11 @@ import { type KlavisServer, KlavisServerStatus } from '@/store/tool/slices/klavi
import { useUserStore } from '@/store/user';
import { userProfileSelectors } from '@/store/user/selectors';
+import { styles } from './style';
+
const POLL_INTERVAL_MS = 1000;
const POLL_TIMEOUT_MS = 15_000;
-const styles = createStaticStyles(({ css, cssVar }) => ({
- connected: css`
- font-size: 14px;
- color: ${cssVar.colorSuccess};
- `,
- container: css`
- padding-block: 12px;
- padding-inline: 0;
- `,
- disconnected: css`
- font-size: 14px;
- color: ${cssVar.colorTextTertiary};
- `,
- error: css`
- font-size: 14px;
- color: ${cssVar.colorError};
- `,
- icon: css`
- display: flex;
- flex-shrink: 0;
- align-items: center;
- justify-content: center;
-
- width: 48px;
- height: 48px;
- border-radius: 12px;
-
- background: ${cssVar.colorFillTertiary};
- `,
- pending: css`
- font-size: 14px;
- color: ${cssVar.colorWarning};
- `,
- title: css`
- cursor: pointer;
- font-size: 15px;
- font-weight: 500;
- color: ${cssVar.colorText};
-
- &:hover {
- color: ${cssVar.colorPrimary};
- }
- `,
-}));
-
interface KlavisSkillItemProps {
server?: KlavisServer;
serverType: KlavisServerType;
@@ -320,21 +277,24 @@ const KlavisSkillItem = memo<KlavisSkillItemProps>(({ serverType, server }) => {
justify="space-between"
>
<Flexbox align="center" gap={16} horizontal style={{ flex: 1, overflow: 'hidden' }}>
- <div className={styles.icon}>{renderIcon()}</div>
- <Flexbox gap={4} style={{ overflow: 'hidden' }}>
- <span
- className={styles.title}
- onClick={() =>
- createIntegrationDetailModal({
- identifier: serverType.identifier,
- serverName: serverType.serverName,
- type: 'klavis',
- })
- }
- >
- {serverType.label}
- </span>
- {!isConnected && renderStatus()}
+ <Flexbox
+ align="center"
+ gap={16}
+ horizontal
+ onClick={() =>
+ createIntegrationDetailModal({
+ identifier: serverType.identifier,
+ serverName: serverType.serverName,
+ type: 'klavis',
+ })
+ }
+ style={{ cursor: 'pointer' }}
+ >
+ <div className={styles.icon}>{renderIcon()}</div>
+ <Flexbox gap={4} style={{ overflow: 'hidden' }}>
+ <span className={styles.title}>{serverType.label}</span>
+ {!isConnected && renderStatus()}
+ </Flexbox>
</Flexbox>
</Flexbox>
<Flexbox align="center" gap={12} horizontal>
diff --git a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx
index 1f9832b0941..005e22edb45 100644
--- a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx
+++ b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx
@@ -3,7 +3,7 @@
import { type LobehubSkillProviderType } from '@lobechat/const';
import { Avatar, DropdownMenu, Flexbox, Icon, Button as LobeButton } from '@lobehub/ui';
import { App, Button } from 'antd';
-import { createStaticStyles, cssVar } from 'antd-style';
+import { cssVar } from 'antd-style';
import { Loader2, MoreHorizontalIcon, SquareArrowOutUpRight, Unplug } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -15,56 +15,11 @@ import {
LobehubSkillStatus,
} from '@/store/tool/slices/lobehubSkillStore/types';
+import { styles } from './style';
+
const POLL_INTERVAL_MS = 1000;
const POLL_TIMEOUT_MS = 15_000;
-const styles = createStaticStyles(({ css, cssVar }) => ({
- connected: css`
- font-size: 14px;
- color: ${cssVar.colorSuccess};
- `,
- container: css`
- padding-block: 12px;
- padding-inline: 0;
- `,
- disconnected: css`
- font-size: 14px;
- color: ${cssVar.colorTextTertiary};
- `,
- disconnectedIcon: css`
- opacity: 0.5;
- `,
- disconnectedTitle: css`
- color: ${cssVar.colorTextTertiary};
- `,
- error: css`
- font-size: 14px;
- color: ${cssVar.colorError};
- `,
- icon: css`
- display: flex;
- flex-shrink: 0;
- align-items: center;
- justify-content: center;
-
- width: 48px;
- height: 48px;
- border-radius: 12px;
-
- background: ${cssVar.colorFillTertiary};
- `,
- title: css`
- cursor: pointer;
- font-size: 15px;
- font-weight: 500;
- color: ${cssVar.colorText};
-
- &:hover {
- color: ${cssVar.colorPrimary};
- }
- `,
-}));
-
interface LobehubSkillItemProps {
provider: LobehubSkillProviderType;
server?: LobehubSkillServer;
@@ -306,22 +261,27 @@ const LobehubSkillItem = memo<LobehubSkillItemProps>(({ provider, server }) => {
justify="space-between"
>
<Flexbox align="center" gap={16} horizontal style={{ flex: 1, overflow: 'hidden' }}>
- <div className={`${styles.icon} ${!isConnected ? styles.disconnectedIcon : ''}`}>
- {renderIcon()}
- </div>
- <Flexbox gap={4} style={{ overflow: 'hidden' }}>
- <span
- className={`${styles.title} ${!isConnected ? styles.disconnectedTitle : ''}`}
- onClick={() =>
- createIntegrationDetailModal({
- identifier: provider.id,
- type: 'lobehub',
- })
- }
- >
- {provider.label}
- </span>
- {!isConnected && renderStatus()}
+ <Flexbox
+ align="center"
+ gap={16}
+ horizontal
+ onClick={() =>
+ createIntegrationDetailModal({
+ identifier: provider.id,
+ type: 'lobehub',
+ })
+ }
+ style={{ cursor: 'pointer' }}
+ >
+ <div className={`${styles.icon} ${!isConnected ? styles.disconnectedIcon : ''}`}>
+ {renderIcon()}
+ </div>
+ <Flexbox gap={4} style={{ overflow: 'hidden' }}>
+ <span className={`${styles.title} ${!isConnected ? styles.disconnectedTitle : ''}`}>
+ {provider.label}
+ </span>
+ {!isConnected && renderStatus()}
+ </Flexbox>
</Flexbox>
</Flexbox>
<Flexbox align="center" gap={12} horizontal>
diff --git a/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx
index 274389dfdf4..6bbf4c9118b 100644
--- a/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx
+++ b/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Flexbox, Modal, Block } from '@lobehub/ui';
-import { createStaticStyles } from 'antd-style';
+import { Flexbox, Modal } from '@lobehub/ui';
import { Suspense, memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -15,35 +14,7 @@ import { pluginSelectors } from '@/store/tool/selectors';
import { type LobeToolType } from '@/types/tool/tool';
import Actions from './Actions';
-
-const styles = createStaticStyles(({ css, cssVar }) => ({
- container: css`
- padding-block: 12px;
- padding-inline: 0;
- `,
- icon: css`
- display: flex;
- flex-shrink: 0;
- align-items: center;
- justify-content: center;
-
- width: 40px;
- height: 40px;
- border-radius: 12px;
-
- background: ${cssVar.colorFillTertiary};
- `,
- title: css`
- cursor: pointer;
- font-size: 15px;
- font-weight: 500;
- color: ${cssVar.colorText};
-
- &:hover {
- color: ${cssVar.colorPrimary};
- }
- `,
-}));
+import { styles } from './style';
interface McpSkillItemProps {
author?: string;
@@ -73,16 +44,20 @@ const McpSkillItem = memo<McpSkillItemProps>(
horizontal
justify="space-between"
>
- <Flexbox align="center" gap={12} horizontal style={{ flex: 1, overflow: 'hidden' }}>
- <Block className={styles.icon} variant={'outlined'}>
- <PluginAvatar avatar={avatar} size={32} />
- </Block>
- <Flexbox align="center" gap={8} horizontal style={{ overflow: 'hidden' }}>
- <span className={styles.title} onClick={() => setDetailOpen(true)}>
- {title}
- </span>
- <PluginTag author={author} isMCP={isMCP} type={type} />
+ <Flexbox align="center" gap={16} horizontal style={{ flex: 1, overflow: 'hidden' }}>
+ <Flexbox
+ align="center"
+ gap={16}
+ horizontal
+ onClick={() => setDetailOpen(true)}
+ style={{ cursor: 'pointer' }}
+ >
+ <div className={styles.icon}>
+ <PluginAvatar avatar={avatar} size={32} />
+ </div>
+ <span className={styles.title}>{title}</span>
</Flexbox>
+ <PluginTag author={author} isMCP={isMCP} type={type} />
</Flexbox>
<Actions identifier={identifier} isMCP={isMCP} type={type} />
</Flexbox>
diff --git a/src/app/[variants]/(main)/settings/skill/features/style.ts b/src/app/[variants]/(main)/settings/skill/features/style.ts
new file mode 100644
index 00000000000..4467bd77869
--- /dev/null
+++ b/src/app/[variants]/(main)/settings/skill/features/style.ts
@@ -0,0 +1,52 @@
+import { createStaticStyles } from 'antd-style';
+
+export const styles = createStaticStyles(({ css, cssVar }) => ({
+ connected: css`
+ font-size: 14px;
+ color: ${cssVar.colorSuccess};
+ `,
+ container: css`
+ padding-block: 12px;
+ padding-inline: 0;
+ `,
+ disconnected: css`
+ font-size: 14px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ disconnectedIcon: css`
+ opacity: 0.5;
+ `,
+ disconnectedTitle: css`
+ color: ${cssVar.colorTextTertiary};
+ `,
+ error: css`
+ font-size: 14px;
+ color: ${cssVar.colorError};
+ `,
+ icon: css`
+ display: flex;
+ flex-shrink: 0;
+ align-items: center;
+ justify-content: center;
+
+ width: 48px;
+ height: 48px;
+ border-radius: 12px;
+
+ background: ${cssVar.colorFillTertiary};
+ `,
+ pending: css`
+ font-size: 14px;
+ color: ${cssVar.colorWarning};
+ `,
+ title: css`
+ cursor: pointer;
+ font-size: 15px;
+ font-weight: 500;
+ color: ${cssVar.colorText};
+
+ &:hover {
+ color: ${cssVar.colorPrimary};
+ }
+ `,
+}));
diff --git a/src/features/ChatInput/ActionBar/Tools/KlavisSkillIcon.tsx b/src/features/ChatInput/ActionBar/Tools/KlavisSkillIcon.tsx
new file mode 100644
index 00000000000..5e38a101090
--- /dev/null
+++ b/src/features/ChatInput/ActionBar/Tools/KlavisSkillIcon.tsx
@@ -0,0 +1,29 @@
+import { type KlavisServerType } from '@lobechat/const';
+import { Icon } from '@lobehub/ui';
+import { cssVar } from 'antd-style';
+import { memo } from 'react';
+
+export const SKILL_ICON_SIZE = 20;
+
+/**
+ * Klavis 服务器图标组件
+ */
+const KlavisSkillIcon = memo<Pick<KlavisServerType, 'icon' | 'label'> & { size: number }>(
+ ({ icon, label, size = SKILL_ICON_SIZE }) => {
+ if (typeof icon === 'string') {
+ return (
+ <img
+ alt={label}
+ src={icon}
+ style={{ maxHeight: size, maxWidth: size, objectFit: 'contain' }}
+ />
+ );
+ }
+
+ return <Icon fill={cssVar.colorText} icon={icon} size={size} />;
+ },
+);
+
+KlavisSkillIcon.displayName = 'KlavisSkillIcon';
+
+export default KlavisSkillIcon;
diff --git a/src/features/ChatInput/ActionBar/Tools/LobehubSkillIcon.tsx b/src/features/ChatInput/ActionBar/Tools/LobehubSkillIcon.tsx
new file mode 100644
index 00000000000..758bddb6ca0
--- /dev/null
+++ b/src/features/ChatInput/ActionBar/Tools/LobehubSkillIcon.tsx
@@ -0,0 +1,29 @@
+import { type LobehubSkillProviderType } from '@lobechat/const';
+import { Icon } from '@lobehub/ui';
+import { cssVar } from 'antd-style';
+import { memo } from 'react';
+
+export const SKILL_ICON_SIZE = 20;
+
+/**
+ * LobeHub Skill Provider 图标组件
+ */
+const LobehubSkillIcon = memo<Pick<LobehubSkillProviderType, 'icon' | 'label'> & { size: number }>(
+ ({ icon, label, size = SKILL_ICON_SIZE }) => {
+ if (typeof icon === 'string') {
+ return (
+ <img
+ alt={label}
+ src={icon}
+ style={{ maxHeight: size, maxWidth: size, objectFit: 'contain' }}
+ />
+ );
+ }
+
+ return <Icon fill={cssVar.colorText} icon={icon} size={size} />;
+ },
+);
+
+LobehubSkillIcon.displayName = 'LobehubSkillIcon';
+
+export default LobehubSkillIcon;
diff --git a/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx b/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx
index b5d99eba485..696603f349a 100644
--- a/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/ToolsList.tsx
@@ -38,10 +38,6 @@ export const toolsListStyles = createStaticStyles(({ css }) => ({
width: 24px;
height: 24px;
-
- .ant-avatar {
- margin-inline-end: 0;
- }
`,
}));
diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.tsx b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
index fd86fd5586e..8e4e5b60c8c 100644
--- a/src/features/ChatInput/ActionBar/Tools/useControls.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
@@ -1,16 +1,13 @@
import {
KLAVIS_SERVER_TYPES,
- type KlavisServerType,
LOBEHUB_SKILL_PROVIDERS,
- type LobehubSkillProviderType,
RECOMMENDED_SKILLS,
RecommendedSkillType,
} from '@lobechat/const';
import { Avatar, Icon, type ItemType } from '@lobehub/ui';
-import { cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { ToyBrick } from 'lucide-react';
-import { memo, useMemo } from 'react';
+import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import PluginAvatar from '@/components/Plugins/PluginAvatar';
@@ -29,55 +26,13 @@ import {
import { useAgentId } from '../../hooks/useAgentId';
import KlavisServerItem from './KlavisServerItem';
+import KlavisSkillIcon from './KlavisSkillIcon';
+import LobehubSkillIcon from './LobehubSkillIcon';
import LobehubSkillServerItem from './LobehubSkillServerItem';
import ToolItem from './ToolItem';
const SKILL_ICON_SIZE = 20;
-/**
- * Klavis 服务器图标组件
- */
-const KlavisIcon = memo<Pick<KlavisServerType, 'icon' | 'label'>>(({ icon, label }) => {
- if (typeof icon === 'string') {
- return (
- <Avatar
- alt={label}
- avatar={icon}
- shape={'square'}
- size={SKILL_ICON_SIZE}
- style={{ flex: 'none' }}
- />
- );
- }
-
- return <Icon fill={cssVar.colorText} icon={icon} size={SKILL_ICON_SIZE} />;
-});
-
-KlavisIcon.displayName = 'KlavisIcon';
-
-/**
- * LobeHub Skill Provider 图标组件
- */
-const LobehubSkillIcon = memo<Pick<LobehubSkillProviderType, 'icon' | 'label'>>(
- ({ icon, label }) => {
- if (typeof icon === 'string') {
- return (
- <Avatar
- alt={label}
- avatar={icon}
- shape={'square'}
- size={SKILL_ICON_SIZE}
- style={{ flex: 'none' }}
- />
- );
- }
-
- return <Icon fill={cssVar.colorText} icon={icon} size={SKILL_ICON_SIZE} />;
- },
-);
-
-LobehubSkillIcon.displayName = 'LobehubSkillIcon';
-
export const useControls = ({ setUpdating }: { setUpdating: (updating: boolean) => void }) => {
const { t } = useTranslation('setting');
const agentId = useAgentId();
@@ -172,7 +127,7 @@ export const useControls = ({ setUpdating }: { setUpdating: (updating: boolean)
(type) =>
installedKlavisIds.has(type.identifier) || recommendedKlavisIds.has(type.identifier),
).map((type) => ({
- icon: <KlavisIcon icon={type.icon} label={type.label} />,
+ icon: <KlavisSkillIcon icon={type.icon} label={type.label} size={SKILL_ICON_SIZE} />,
key: type.identifier,
label: (
<KlavisServerItem
@@ -196,7 +151,13 @@ export const useControls = ({ setUpdating }: { setUpdating: (updating: boolean)
(provider) =>
installedLobehubIds.has(provider.id) || recommendedLobehubIds.has(provider.id),
).map((provider) => ({
- icon: <LobehubSkillIcon icon={provider.icon} label={provider.label} />,
+ icon: (
+ <LobehubSkillIcon
+ icon={provider.icon}
+ label={provider.label}
+ size={SKILL_ICON_SIZE}
+ />
+ ),
key: provider.id, // 使用 provider.id 作为 key,与 pluginId 保持一致
label: (
<LobehubSkillServerItem
diff --git a/src/features/IntegrationDetailModal/IntegrationDetailContent.tsx b/src/features/IntegrationDetailModal/IntegrationDetailContent.tsx
index 8fc02c9e3e3..4d27e073564 100644
--- a/src/features/IntegrationDetailModal/IntegrationDetailContent.tsx
+++ b/src/features/IntegrationDetailModal/IntegrationDetailContent.tsx
@@ -6,7 +6,7 @@ import {
getKlavisServerByServerIdentifier,
getLobehubSkillProviderById,
} from '@lobechat/const';
-import { Flexbox, Icon, Image, Tag, Text, Typography, useModalContext } from '@lobehub/ui';
+import { Flexbox, Icon, Tag, Text, Typography, useModalContext } from '@lobehub/ui';
import { Button, Divider } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import type { Klavis } from 'klavis';
@@ -20,6 +20,8 @@ import { klavisStoreSelectors, lobehubSkillStoreSelectors } from '@/store/tool/s
import { KlavisServerStatus } from '@/store/tool/slices/klavisStore';
import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types';
+const ICON_SIZE = 56;
+
const styles = createStaticStyles(({ css, cssVar }) => ({
authorLink: css`
cursor: pointer;
@@ -59,11 +61,8 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
align-items: center;
justify-content: center;
- width: 56px;
- height: 56px;
- border-radius: 12px;
-
- background: ${cssVar.colorBgContainer};
+ width: ${ICON_SIZE}px;
+ height: ${ICON_SIZE}px;
`,
introduction: css`
font-size: 14px;
@@ -185,9 +184,15 @@ export const IntegrationDetailContent = ({
const renderIcon = () => {
if (typeof icon === 'string') {
- return <Image alt={label} height={36} src={icon} width={36} />;
+ return (
+ <img
+ alt={label}
+ src={icon}
+ style={{ maxHeight: ICON_SIZE, maxWidth: ICON_SIZE, objectFit: 'contain' }}
+ />
+ );
}
- return <Icon fill={cssVar.colorText} icon={icon} size={36} />;
+ return <Icon fill={cssVar.colorText} icon={icon} size={ICON_SIZE} />;
};
const handleAuthorClick = () => {
diff --git a/src/features/ProfileEditor/AgentTool.tsx b/src/features/ProfileEditor/AgentTool.tsx
index d8e275f2949..156fda84659 100644
--- a/src/features/ProfileEditor/AgentTool.tsx
+++ b/src/features/ProfileEditor/AgentTool.tsx
@@ -1,11 +1,6 @@
'use client';
-import {
- KLAVIS_SERVER_TYPES,
- type KlavisServerType,
- LOBEHUB_SKILL_PROVIDERS,
- type LobehubSkillProviderType,
-} from '@lobechat/const';
+import { KLAVIS_SERVER_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const';
import { Avatar, Button, Flexbox, Icon, type ItemType } from '@lobehub/ui';
import { cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
@@ -15,6 +10,10 @@ import { useTranslation } from 'react-i18next';
import PluginAvatar from '@/components/Plugins/PluginAvatar';
import KlavisServerItem from '@/features/ChatInput/ActionBar/Tools/KlavisServerItem';
+import KlavisSkillIcon, {
+ SKILL_ICON_SIZE,
+} from '@/features/ChatInput/ActionBar/Tools/KlavisSkillIcon';
+import LobehubSkillIcon from '@/features/ChatInput/ActionBar/Tools/LobehubSkillIcon';
import LobehubSkillServerItem from '@/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem';
import ToolItem from '@/features/ChatInput/ActionBar/Tools/ToolItem';
import ActionDropdown from '@/features/ChatInput/ActionBar/components/ActionDropdown';
@@ -40,48 +39,6 @@ const WEB_BROWSING_IDENTIFIER = 'lobe-web-browsing';
type TabType = 'all' | 'installed';
-const SKILL_ICON_SIZE = 20;
-
-/**
- * Klavis 服务器图标组件
- */
-const KlavisIcon = memo<Pick<KlavisServerType, 'icon' | 'label'>>(({ icon, label }) => {
- if (typeof icon === 'string') {
- return (
- <Avatar
- alt={label}
- avatar={icon}
- shape={'square'}
- size={SKILL_ICON_SIZE}
- style={{ flex: 'none' }}
- />
- );
- }
-
- return <Icon fill={cssVar.colorText} icon={icon} size={SKILL_ICON_SIZE} />;
-});
-
-/**
- * LobeHub Skill Provider 图标组件
- */
-const LobehubSkillIcon = memo<Pick<LobehubSkillProviderType, 'icon' | 'label'>>(
- ({ icon, label }) => {
- if (typeof icon === 'string') {
- return (
- <Avatar
- alt={label}
- avatar={icon}
- shape={'square'}
- size={SKILL_ICON_SIZE}
- style={{ flex: 'none' }}
- />
- );
- }
-
- return <Icon fill={cssVar.colorText} icon={icon} size={SKILL_ICON_SIZE} />;
- },
-);
-
export interface AgentToolProps {
/**
* Optional agent ID to use instead of currentAgentConfig
@@ -267,7 +224,7 @@ const AgentTool = memo<AgentToolProps>(
() =>
isKlavisEnabledInEnv
? KLAVIS_SERVER_TYPES.map((type) => ({
- icon: <KlavisIcon icon={type.icon} label={type.label} />,
+ icon: <KlavisSkillIcon icon={type.icon} label={type.label} size={SKILL_ICON_SIZE} />,
key: type.identifier,
label: (
<KlavisServerItem
@@ -288,7 +245,13 @@ const AgentTool = memo<AgentToolProps>(
() =>
isLobehubSkillEnabled
? LOBEHUB_SKILL_PROVIDERS.map((provider) => ({
- icon: <LobehubSkillIcon icon={provider.icon} label={provider.label} />,
+ icon: (
+ <LobehubSkillIcon
+ icon={provider.icon}
+ label={provider.label}
+ size={SKILL_ICON_SIZE}
+ />
+ ),
key: provider.id, // 使用 provider.id 作为 key,与 pluginId 保持一致
label: (
<LobehubSkillServerItem
@@ -327,9 +290,8 @@ const AgentTool = memo<AgentToolProps>(
icon: (
<Avatar
avatar={item.meta.avatar}
- shape={'square'}
size={SKILL_ICON_SIZE}
- style={{ flex: 'none' }}
+ style={{ marginInlineEnd: 0 }}
/>
),
key: item.identifier,
@@ -362,7 +324,11 @@ const AgentTool = memo<AgentToolProps>(
const mapPluginToItem = useCallback(
(item: (typeof installedPluginList)[0]) => ({
icon: item?.avatar ? (
- <PluginAvatar avatar={item.avatar} size={SKILL_ICON_SIZE} />
+ <PluginAvatar
+ avatar={item.avatar}
+ size={SKILL_ICON_SIZE}
+ style={{ marginInlineEnd: 0 }}
+ />
) : (
<Icon icon={ToyBrick} size={SKILL_ICON_SIZE} />
),
@@ -446,9 +412,8 @@ const AgentTool = memo<AgentToolProps>(
icon: (
<Avatar
avatar={item.meta.avatar}
- shape={'square'}
size={SKILL_ICON_SIZE}
- style={{ flex: 'none' }}
+ style={{ marginInlineEnd: 0 }}
/>
),
key: item.identifier,