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.

✨ feat(skills): focus the Skills settings store on marketplace skills (#23478)

AmAzing-4a23eec771d2
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index 73444a2b712..303159ad825 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -2180,6 +2180,7 @@
"skillStore.button": "Skill Store",
"skillStore.empty": "Browse the Skill Store. Install one to get started, add more later.",
"skillStore.emptySearch": "No matching Skills",
+ "skillStore.marketEmpty": "No skills are available in the store yet.",
"skillStore.networkError": "Network error, please try again",
"skillStore.rateLimited": "Too many requests just now. Please wait a moment and try again.",
"skillStore.search": "Search skills by name or keyword, press Enter to search…",
@@ -2193,6 +2194,7 @@
"skillStore.wantMore.feedback.message": "## Skill Name\n[Please fill in]\n\n## Use Case\nWhen I am ___, I need ___\n\n## Expected Features\n1.\n2.\n3.\n\n## Reference Examples\n(Optional) Are there any similar tools or features for reference?\n\n---\n💡 Tip: The more specific your description, the better we can meet your needs",
"skillStore.wantMore.feedback.title": "[Skill Request] Summarize the skill you need in one sentence",
"skillStore.wantMore.reachedEnd": "You've reached the end. Can't find what you need?",
+ "skillView.browseStoreDesc": "Find and install skills for your agents",
"skillView.connectors": "Connectors",
"skillView.connectorsDesc": "Connect the apps and tools your agents can use. Open one to see its account and tools.",
"skillView.empty.description": "Browse the Skill Store or import a skill from the Add menu.",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index c3d39ee4e1d..08d3b139abe 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -2180,6 +2180,7 @@
"skillStore.button": "技能商店",
"skillStore.empty": "浏览技能商店。安装一个技能开始使用,之后可随时添加更多。",
"skillStore.emptySearch": "未找到匹配的技能",
+ "skillStore.marketEmpty": "技能商店暂无可用技能。",
"skillStore.networkError": "网络错误,请重试",
"skillStore.rateLimited": "刚才的请求有点频繁,请稍等片刻再试。",
"skillStore.search": "搜索技能名称或关键词,按回车键搜索…",
@@ -2193,6 +2194,7 @@
"skillStore.wantMore.feedback.message": "## 技能名称\n[请填写]\n\n## 使用场景\n当我在___时,我需要___\n\n## 期望功能\n1.\n2.\n3.\n\n## 参考示例\n(可选)是否有类似的工具或功能可供参考?\n\n---\n💡 提示:描述越具体,我们就越能满足您的需求",
"skillStore.wantMore.feedback.title": "[技能申请] 请用一句话概括您需要的技能",
"skillStore.wantMore.reachedEnd": "已经到底了,未找到所需技能?",
+ "skillView.browseStoreDesc": "查找并安装适合助理的技能",
"skillView.connectors": "连接器",
"skillView.connectorsDesc": "连接助理可以调用的应用和工具。点开一项,查看授权账号和工具清单。",
"skillView.empty.description": "通过「添加」菜单浏览技能商店或导入技能。",
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index 691145742ab..22d5ebe40e1 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -2043,6 +2043,7 @@ export default {
'skillStore.button': 'Skill Store',
'skillStore.empty': 'Browse the Skill Store. Install one to get started, add more later.',
'skillStore.emptySearch': 'No matching Skills',
+ 'skillStore.marketEmpty': 'No skills are available in the store yet.',
'skillStore.networkError': 'Network error, please try again',
'skillStore.rateLimited': 'Too many requests just now. Please wait a moment and try again.',
'skillStore.search': 'Search skills by name or keyword, press Enter to search…',
@@ -2072,6 +2073,7 @@ When I am ___, I need ___
'skillStore.wantMore.feedback.title':
'[Skill Request] Summarize the skill you need in one sentence',
'skillStore.wantMore.reachedEnd': "You've reached the end. Can't find what you need?",
+ 'skillView.browseStoreDesc': 'Find and install skills for your agents',
'skillView.connectors': 'Connectors',
'skillView.connectorsDesc':
'Connect the apps and tools your agents can use. Open one to see its account and tools.',
diff --git a/src/components/SkillAvatar/index.tsx b/src/components/SkillAvatar/index.tsx
index 6fbb73b0303..baba2151065 100644
--- a/src/components/SkillAvatar/index.tsx
+++ b/src/components/SkillAvatar/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Center } from '@lobehub/ui';
+import { Center, cssVar } from '@lobehub/ui';
import { SkillsIcon } from '@lobehub/ui/icons';
import { type CSSProperties, memo } from 'react';
@@ -17,14 +17,14 @@ const SkillAvatar = memo<SkillAvatarProps>(({ size = 40, className, style }) =>
flex={'none'}
style={{
borderRadius: Math.floor(size * 0.1),
- color: '#000',
+ color: cssVar.colorText,
height: size,
overflow: 'hidden',
width: size,
...style,
}}
>
- <SkillsIcon color={'#000'} size={size} style={{ transform: 'scale(0.75)' }} />
+ <SkillsIcon size={size} style={{ transform: 'scale(0.75)' }} />
</Center>
);
});
diff --git a/src/features/AgentSkillDetail/index.tsx b/src/features/AgentSkillDetail/index.tsx
index 8596ddb9c22..06c893e4c11 100644
--- a/src/features/AgentSkillDetail/index.tsx
+++ b/src/features/AgentSkillDetail/index.tsx
@@ -7,6 +7,7 @@ import { DotIcon, ExternalLinkIcon } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import MarketSkillIcon from '@/components/MarketSkillIcon';
import PublishedTime from '@/components/PublishedTime';
import { ArticleSkeleton } from '@/components/Skeleton';
import SkillAvatar from '@/components/SkillAvatar';
@@ -123,7 +124,16 @@ const AgentSkillDetail = memo<AgentSkillDetailProps>(({ skillId }) => {
{skillDetail && (
<div className={styles.meta}>
<Flexbox horizontal align={'center'} gap={12}>
- <SkillAvatar size={40} />
+ {skillDetail.source === 'market' ? (
+ <MarketSkillIcon
+ fallback={<SkillAvatar size={40} />}
+ identifier={skillDetail.identifier}
+ name={skillDetail.name}
+ size={40}
+ />
+ ) : (
+ <SkillAvatar size={40} />
+ )}
<Flexbox className={styles.headerText} flex={1} justify={'space-between'}>
<Flexbox horizontal align={'center'} gap={8} justify={'space-between'}>
<Flexbox horizontal align={'center'} className={styles.description} gap={4}>
diff --git a/src/features/Settings/skill/features/AgentSkillItem.tsx b/src/features/Settings/skill/features/AgentSkillItem.tsx
index 6f4b0d26dd1..497a6f96ea3 100644
--- a/src/features/Settings/skill/features/AgentSkillItem.tsx
+++ b/src/features/Settings/skill/features/AgentSkillItem.tsx
@@ -14,10 +14,11 @@ import {
} from '@lobehub/ui';
import { SkillsIcon } from '@lobehub/ui/icons';
import * as stylex from '@stylexjs/stylex';
-import { DownloadIcon, MoreHorizontalIcon, Plus, Settings2, Trash2 } from 'lucide-react';
+import { DownloadIcon, MoreHorizontalIcon, Plus, Trash2 } from 'lucide-react';
import { lazy, memo, Suspense, useState } from 'react';
import { useTranslation } from 'react-i18next';
+import MarketSkillIcon from '@/components/MarketSkillIcon';
import { GitHubSkillUpdate, hasGitHubSource } from '@/features/AgentSkillDetail/GitHubSkillUpdate';
import NavItem from '@/features/NavPanel/components/NavItem';
import { createBuiltinAgentSkillDetailModal } from '@/features/SkillStore/SkillDetail';
@@ -33,7 +34,6 @@ import SkillListRow, { useSkillListVariant } from './SkillListRow';
import { styles } from './style';
const AgentSkillDetail = lazy(() => import('@/features/AgentSkillDetail'));
-const AgentSkillEdit = lazy(() => import('@/features/AgentSkillEdit'));
const isBuiltinSkill = (
skill: BuiltinSkillManifest | SkillListItem,
@@ -50,7 +50,6 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
const { t: tc } = useTranslation('common');
const { t: tp } = useTranslation('plugin');
const [loading, setLoading] = useState(false);
- const [editOpen, setEditOpen] = useState(false);
const { allowed: canCreate } = usePermission('create_content');
const { allowed: canEdit } = usePermission('edit_own_content');
@@ -69,7 +68,21 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
? t(`tools.builtins.${skill.identifier}.title`, { defaultValue: skill.name })
: skill.name;
- const avatar = isBuiltin ? skill.avatar : undefined;
+ const renderIcon = (size: number, marketSize = size) => {
+ if (isBuiltin && skill.avatar) return <Avatar avatar={skill.avatar} size={size} />;
+
+ const fallback = <Icon icon={SkillsIcon} size={size} />;
+ if (skill.source !== 'market') return fallback;
+
+ return (
+ <MarketSkillIcon
+ fallback={fallback}
+ identifier={skill.identifier}
+ name={skill.name}
+ size={marketSize}
+ />
+ );
+ };
// ===== Handlers =====
@@ -138,7 +151,11 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
},
]}
>
- <Button disabled={!canEdit} icon={<Icon icon={MoreHorizontalIcon} />} />
+ <Button
+ aria-label={t('connectorMarket.action.manage')}
+ disabled={!canEdit}
+ icon={<Icon icon={MoreHorizontalIcon} />}
+ />
</DropdownMenu>
);
}
@@ -157,37 +174,37 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
}
return (
- <Flexbox horizontal gap={4}>
- <Button disabled={!canEdit} onClick={() => setEditOpen(true)}>
- {tp('store.actions.configure')}
- </Button>
- <DropdownMenu
- placement="bottomRight"
- items={[
- ...(skill.zipFileHash
- ? [
- {
- icon: <DownloadIcon size={16} />,
- key: 'download',
- label: tc('download'),
- onClick: handleDownload,
- },
- { type: 'divider' as const },
- ]
- : []),
- {
- danger: true,
- disabled: !canEdit,
- icon: <Trash2 size={16} />,
- key: 'uninstall',
- label: tp('store.actions.uninstall'),
- onClick: handleUninstall,
- },
- ]}
- >
- <Button disabled={!canEdit} icon={<Icon icon={MoreHorizontalIcon} />} loading={loading} />
- </DropdownMenu>
- </Flexbox>
+ <DropdownMenu
+ placement="bottomRight"
+ items={[
+ ...(skill.zipFileHash
+ ? [
+ {
+ icon: <DownloadIcon size={16} />,
+ key: 'download',
+ label: tc('download'),
+ onClick: handleDownload,
+ },
+ { type: 'divider' as const },
+ ]
+ : []),
+ {
+ danger: true,
+ disabled: !canEdit,
+ icon: <Trash2 size={16} />,
+ key: 'uninstall',
+ label: tp('store.actions.uninstall'),
+ onClick: handleUninstall,
+ },
+ ]}
+ >
+ <Button
+ aria-label={t('connectorMarket.action.manage')}
+ disabled={!canEdit}
+ icon={<Icon icon={MoreHorizontalIcon} />}
+ loading={loading}
+ />
+ </DropdownMenu>
);
};
@@ -211,92 +228,67 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
}
};
- const renderDetailModal = () => {
- if (isBuiltin) return null;
- return (
- <Suspense>
- <AgentSkillEdit open={editOpen} skillId={skill.id} onClose={() => setEditOpen(false)} />
- </Suspense>
- );
- };
-
const showDisconnected = isBuiltin && !isBuiltinInstalled;
if (isPage) {
return (
- <>
- <SkillListRow
- active={isSelected}
- description={updateAction}
- title={title}
- extra={
- showDisconnected ? (
- <RowAddAction
- disabled={!canCreate}
- label={tp('store.actions.install')}
- loading={loading}
- onClick={async () => {
- if (!canCreate || loading) return;
- setLoading(true);
- try {
- await installBuiltinTool(skill.identifier);
- } finally {
- setLoading(false);
- }
- }}
- />
- ) : (
- <RowMoreMenu
- items={[
- ...(!isBuiltin
- ? [
- {
- disabled: !canEdit || !canManage,
- icon: <Icon icon={Settings2} />,
- key: 'configure',
- label: tp('store.actions.configure'),
- onClick: () => setEditOpen(true),
- },
- ]
- : []),
- ...(!isBuiltin && skill.zipFileHash
- ? [
- {
- disabled: loading,
- icon: <Icon icon={DownloadIcon} />,
- key: 'download',
- label: tc('download'),
- onClick: handleDownload,
- },
- ]
- : []),
- {
- danger: true,
- disabled: !canEdit || !canManage || loading,
- icon: <Icon icon={Trash2} />,
- key: 'uninstall',
- label: tp('store.actions.uninstall'),
- onClick: handleUninstall,
- },
- ]}
- onOpenDetail={onSelect ?? handleOpenDetail}
- />
- )
- }
- icon={() =>
- avatar ? <Avatar avatar={avatar} size={20} /> : <Icon icon={SkillsIcon} size={20} />
- }
- summary={
- isBuiltin
- ? t(`tools.builtins.${skill.identifier}.description`, {
- defaultValue: skill.description,
- })
- : skill.description
- }
- onClick={onSelect ?? handleOpenDetail}
- />
- {editOpen && renderDetailModal()}
- </>
+ <SkillListRow
+ active={isSelected}
+ description={updateAction}
+ icon={() => renderIcon(20, 40)}
+ title={title}
+ extra={
+ showDisconnected ? (
+ <RowAddAction
+ disabled={!canCreate}
+ label={tp('store.actions.install')}
+ loading={loading}
+ onClick={async () => {
+ if (!canCreate || loading) return;
+ setLoading(true);
+ try {
+ await installBuiltinTool(skill.identifier);
+ } finally {
+ setLoading(false);
+ }
+ }}
+ />
+ ) : (
+ <RowMoreMenu
+ items={[
+ ...(!isBuiltin && skill.zipFileHash
+ ? [
+ {
+ disabled: loading,
+ icon: <Icon icon={DownloadIcon} />,
+ key: 'download',
+ label: tc('download'),
+ onClick: handleDownload,
+ },
+ ]
+ : []),
+ {
+ danger: true,
+ disabled: !canEdit || !canManage || loading,
+ icon: <Icon icon={Trash2} />,
+ key: 'uninstall',
+ label: tp('store.actions.uninstall'),
+ onClick: handleUninstall,
+ },
+ ]}
+ onOpenDetail={onSelect ?? handleOpenDetail}
+ />
+ )
+ }
+ summary={
+ isBuiltin
+ ? t(`tools.builtins.${skill.identifier}.description`, {
+ defaultValue: skill.description,
+ })
+ : skill.description
+ }
+ onClick={onSelect ?? handleOpenDetail}
+ />
);
}
@@ -305,57 +297,52 @@ const AgentSkillItem = memo<AgentSkillItemProps>(({ skill, isSelected, onSelect
<NavItem
active={isSelected}
extra={updateAction}
+ icon={() => renderIcon(18)}
title={title}
titleColor={showDisconnected ? cssVar.colorTextDescription : undefined}
- icon={() =>
- avatar ? <Avatar avatar={avatar} size={18} /> : <Icon icon={SkillsIcon} size={18} />
- }
onClick={onSelect}
/>
);
}
return (
- <>
- <Flexbox
- horizontal
- align="center"
- className={stylex.props(styles.container).className}
- gap={16}
- justify="space-between"
- style={{
- ...(isSelected ? { background: 'var(--lobe-color-primary-bg)', borderRadius: 6 } : {}),
- ...(onSelect ? { cursor: 'pointer' } : {}),
- }}
- onClick={onSelect}
- >
- <Flexbox horizontal align="center" gap={8} style={{ flex: 1, overflow: 'hidden' }}>
- <Flexbox
- horizontal
- align="center"
- gap={8}
- style={{ cursor: onSelect ? undefined : 'pointer' }}
- onClick={onSelect ? undefined : handleOpenDetail}
- >
- <div {...stylex.props(styles.icon, showDisconnected && styles.disconnectedIcon)}>
- {avatar ? <Avatar avatar={avatar} size={16} /> : <Icon icon={SkillsIcon} size={16} />}
- </div>
- <span {...stylex.props(styles.title, showDisconnected && styles.disconnectedTitle)}>
- {title}
- </span>
- </Flexbox>
- {showDisconnected && renderStatus()}
+ <Flexbox
+ horizontal
+ align="center"
+ className={stylex.props(styles.container).className}
+ gap={16}
+ justify="space-between"
+ style={{
+ ...(isSelected ? { background: 'var(--lobe-color-primary-bg)', borderRadius: 6 } : {}),
+ ...(onSelect ? { cursor: 'pointer' } : {}),
+ }}
+ onClick={onSelect}
+ >
+ <Flexbox horizontal align="center" gap={8} style={{ flex: 1, overflow: 'hidden' }}>
+ <Flexbox
+ horizontal
+ align="center"
+ gap={8}
+ style={{ cursor: onSelect ? undefined : 'pointer' }}
+ onClick={onSelect ? undefined : handleOpenDetail}
+ >
+ <div {...stylex.props(styles.icon, showDisconnected && styles.disconnectedIcon)}>
+ {renderIcon(16)}
+ </div>
+ <span {...stylex.props(styles.title, showDisconnected && styles.disconnectedTitle)}>
+ {title}
+ </span>
</Flexbox>
- {!onSelect && (
- <Flexbox horizontal align="center" gap={8} onClick={stopPropagation}>
- {isBuiltin && isBuiltinInstalled && renderStatus()}
- {updateAction}
- {renderActions()}
- </Flexbox>
- )}
+ {showDisconnected && renderStatus()}
</Flexbox>
- {!onSelect && renderDetailModal()}
- </>
+ {!onSelect && (
+ <Flexbox horizontal align="center" gap={8} onClick={stopPropagation}>
+ {isBuiltin && isBuiltinInstalled && renderStatus()}
+ {updateAction}
+ {renderActions()}
+ </Flexbox>
+ )}
+ </Flexbox>
);
});
diff --git a/src/features/Settings/skill/features/LeftPanel.tsx b/src/features/Settings/skill/features/LeftPanel.tsx
index fc6f77c69f6..769e00e2fb3 100644
--- a/src/features/Settings/skill/features/LeftPanel.tsx
+++ b/src/features/Settings/skill/features/LeftPanel.tsx
@@ -4,12 +4,12 @@ import { Button, DropdownMenu, Flexbox, Icon, SearchBar, Text, Tooltip } from '@
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
import * as stylex from '@stylexjs/stylex';
import { ChevronDown, Grid2x2Plus, Import, Plus, Store } from 'lucide-react';
-import { memo, useCallback, useState } from 'react';
+import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { CustomConnectorModal } from '@/features/Connectors';
import { NavPanelDensityContext } from '@/features/NavPanel/density';
-import { createSkillStoreModal } from '@/features/SkillStore';
+import { createMarketSkillStoreModal, createSkillStoreModal } from '@/features/SkillStore';
import { openSkillImportModal } from '@/features/SkillStore/SkillImportModal';
import { useConnectorManageable } from '@/hooks/useConnectorManagePolicy';
import { usePermission } from '@/hooks/usePermission';
@@ -103,11 +103,8 @@ const LeftPanel = memo<LeftPanelProps>(
const [showAddConnector, setShowAddConnector] = useState(false);
const [keyword, setKeyword] = useState('');
- const handleOpenStore = useCallback(() => {
- createSkillStoreModal();
- }, []);
-
const isConnectorView = viewMode === 'connector';
+ const handleOpenStore = isConnectorView ? createSkillStoreModal : createMarketSkillStoreModal;
const { allowed: canCreate } = usePermission('create_content');
// Adding a workspace connector follows the same member policy as editing one.
const { canManage: canAddConnector, isPending: isPolicyPending } = useConnectorManageable();
@@ -133,7 +130,9 @@ const LeftPanel = memo<LeftPanelProps>(
]
: []),
{
- desc: t('connectorMarket.add.browseStoreDesc'),
+ desc: t(
+ isConnectorView ? 'connectorMarket.add.browseStoreDesc' : 'skillView.browseStoreDesc',
+ ),
icon: <Icon icon={Store} />,
key: 'store',
label: t('connectorMarket.add.browseStore'),
diff --git a/src/features/SkillStore/MarketSkillStoreContent.tsx b/src/features/SkillStore/MarketSkillStoreContent.tsx
new file mode 100644
index 00000000000..0cd10fc8e90
--- /dev/null
+++ b/src/features/SkillStore/MarketSkillStoreContent.tsx
@@ -0,0 +1,28 @@
+'use client';
+
+import { Flexbox, SearchBar } from '@lobehub/ui';
+import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import MarketSkillList from './SkillList/MarketSkills';
+
+export const MarketSkillStoreContent = () => {
+ const { t } = useTranslation('setting');
+ const [keywords, setKeywords] = useState('');
+
+ return (
+ <Flexbox gap={12}>
+ <SearchBar
+ allowClear
+ aria-label={t('skillView.search.placeholder')}
+ placeholder={t('skillStore.search')}
+ variant={'outlined'}
+ onClear={() => setKeywords('')}
+ onSearch={(value) => setKeywords(value.trim())}
+ />
+ <Flexbox height={'60vh'} style={{ marginInline: -16 }}>
+ <MarketSkillList keywords={keywords} />
+ </Flexbox>
+ </Flexbox>
+ );
+};
diff --git a/src/features/SkillStore/SkillList/Community/MarketSkillItem.tsx b/src/features/SkillStore/SkillList/Community/MarketSkillItem.tsx
index 4011ba48c1d..bc4c6f1389a 100644
--- a/src/features/SkillStore/SkillList/Community/MarketSkillItem.tsx
+++ b/src/features/SkillStore/SkillList/Community/MarketSkillItem.tsx
@@ -11,9 +11,7 @@ import {
DropdownMenu,
Flexbox,
Icon,
- Tag,
} from '@lobehub/ui';
-import { SkillsIcon } from '@lobehub/ui/icons';
import { t as translate } from 'i18next';
import { DownloadIcon, Loader2, MoreHorizontalIcon, Plus, Trash2 } from 'lucide-react';
import { lazy, memo, Suspense, useCallback, useState } from 'react';
@@ -35,12 +33,19 @@ const styles = createStaticStyles(({ css }) => ({
cursor: pointer;
overflow: hidden;
+ align-self: flex-start;
+ max-width: 100%;
+ padding: 0;
+ border: 0;
+ font-family: inherit;
font-size: 14px;
font-weight: 500;
+ line-height: inherit;
color: ${cssVar.colorText};
text-overflow: ellipsis;
white-space: nowrap;
+ background: transparent;
&:hover {
color: ${cssVar.colorPrimary};
@@ -178,12 +183,13 @@ const MarketSkillItem = memo<DiscoverSkillItem>(({ name, icon, description, iden
>
<Avatar avatar={icon || name} shape={'square'} size={40} style={{ flex: 'none' }} />
<Flexbox flex={1} gap={4} style={{ minWidth: 0, overflow: 'hidden' }}>
- <Flexbox horizontal align="center" gap={8}>
- <span className={styles.title} onClick={() => openMarketSkillDetailModal(identifier)}>
- {name}
- </span>
- <Tag icon={<Icon icon={SkillsIcon} />} size={'small'} />
- </Flexbox>
+ <button
+ className={styles.title}
+ type="button"
+ onClick={() => openMarketSkillDetailModal(identifier)}
+ >
+ {name}
+ </button>
{description && <span className={itemStyles.description}>{description}</span>}
</Flexbox>
{renderAction()}
diff --git a/src/features/SkillStore/SkillList/MarketSkills/index.tsx b/src/features/SkillStore/SkillList/MarketSkills/index.tsx
index 223b45c26e1..699c4dd1da9 100644
--- a/src/features/SkillStore/SkillList/MarketSkills/index.tsx
+++ b/src/features/SkillStore/SkillList/MarketSkills/index.tsx
@@ -53,7 +53,13 @@ const MarketSkillList = memo<MarketSkillListProps>(({ keywords }) => {
);
}
- if (items.length === 0) return <Empty search={Boolean(keywords?.trim())} />;
+ if (items.length === 0)
+ return (
+ <Empty
+ action={null}
+ description={keywords?.trim() ? t('skillStore.emptySearch') : t('skillStore.marketEmpty')}
+ />
+ );
const hasReachedEnd = totalPages !== undefined && page >= totalPages;
diff --git a/src/features/SkillStore/index.tsx b/src/features/SkillStore/index.tsx
index 70444f0f973..1f433153dcf 100644
--- a/src/features/SkillStore/index.tsx
+++ b/src/features/SkillStore/index.tsx
@@ -2,20 +2,22 @@
import { createModal } from '@lobehub/ui';
import { t } from 'i18next';
+import type { ReactNode } from 'react';
import { isDesktop } from '@/const/version';
import { MarketAuthProvider } from '@/layout/AuthProvider/MarketAuth';
+import { MarketSkillStoreContent } from './MarketSkillStoreContent';
import { SkillStoreContent } from './SkillStoreContent';
-export const createSkillStoreModal = () =>
+const openStore = (content: ReactNode) =>
createModal({
- content: (
- <MarketAuthProvider isDesktop={isDesktop}>
- <SkillStoreContent />
- </MarketAuthProvider>
- ),
+ content: <MarketAuthProvider isDesktop={isDesktop}>{content}</MarketAuthProvider>,
footer: null,
title: t('skillStore.title', { ns: 'setting' }),
width: 'min(80%, 800px)',
});
+
+export const createSkillStoreModal = () => openStore(<SkillStoreContent />);
+
+export const createMarketSkillStoreModal = () => openStore(<MarketSkillStoreContent />);