🤯 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
chore: refactor skill detail page
rdmclin26c1eadc638b3
diff --git a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsxindex 7b49512dfac..9e7ba575648 100644--- a/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx+++ b/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx@@ -8,7 +8,7 @@ import { Loader2, MoreHorizontalIcon, SquareArrowOutUpRight, Unplug } from 'luciimport { memo, useCallback, useEffect, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import { createIntegrationDetailModal } from '@/features/SkillStore/IntegrationDetail';+import { createKlavisSkillDetailModal } from '@/features/SkillStore/SkillDetail';import { useToolStore } from '@/store/tool';import { type KlavisServer, KlavisServerStatus } from '@/store/tool/slices/klavisStore';import { useUserStore } from '@/store/user';@@ -282,10 +282,9 @@ const KlavisSkillItem = memo<KlavisSkillItemProps>(({ serverType, server }) => {gap={16}horizontalonClick={() =>- createIntegrationDetailModal({+ createKlavisSkillDetailModal({identifier: serverType.identifier,serverName: serverType.serverName,- type: 'klavis',})}style={{ cursor: 'pointer' }}diff --git a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsxindex 098b1971123..fb8e8a7b052 100644--- a/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx+++ b/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx@@ -8,7 +8,7 @@ import { Loader2, MoreHorizontalIcon, SquareArrowOutUpRight, Unplug } from 'luciimport { memo, useCallback, useEffect, useRef, useState } from 'react';import { useTranslation } from 'react-i18next';-import { createIntegrationDetailModal } from '@/features/SkillStore/IntegrationDetail';+import { createLobehubSkillDetailModal } from '@/features/SkillStore/SkillDetail';import { useToolStore } from '@/store/tool';import {type LobehubSkillServer,@@ -266,9 +266,8 @@ const LobehubSkillItem = memo<LobehubSkillItemProps>(({ provider, server }) => {gap={16}horizontalonClick={() =>- createIntegrationDetailModal({+ createLobehubSkillDetailModal({identifier: provider.id,- type: 'lobehub',})}style={{ cursor: 'pointer' }}diff --git a/src/features/SkillStore/IntegrationDetail/DetailProvider.tsx b/src/features/SkillStore/IntegrationDetail/DetailProvider.tsxdeleted file mode 100644index e8c709dc47c..00000000000--- a/src/features/SkillStore/IntegrationDetail/DetailProvider.tsx+++ /dev/null@@ -1,115 +0,0 @@-'use client';--import {- type KlavisServerType,- type LobehubSkillProviderType,- getKlavisServerByServerIdentifier,- getLobehubSkillProviderById,-} from '@lobechat/const';-import type { Klavis } from 'klavis';-import React, { type ReactNode, createContext, useContext, useMemo } from 'react';-import { useTranslation } from 'react-i18next';--import { useToolStore } from '@/store/tool';-import { klavisStoreSelectors, lobehubSkillStoreSelectors } from '@/store/tool/selectors';-import { KlavisServerStatus } from '@/store/tool/slices/klavisStore';-import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types';--export type IntegrationType = 'klavis' | 'lobehub';--export interface DetailContextValue {- author: string;- authorUrl?: string;- config: KlavisServerType | LobehubSkillProviderType;- description: string;- icon: string | React.ComponentType<any>;- identifier: string;- introduction: string;- isConnected: boolean;- label: string;- localizedDescription: string;- localizedIntroduction: string;- serverName?: Klavis.McpServerName;- type: IntegrationType;-}--const DetailContext = createContext<DetailContextValue | null>(null);--export const useDetailContext = () => {- const context = useContext(DetailContext);- if (!context) {- throw new Error('useDetailContext must be used within DetailProvider');- }- return context;-};--interface DetailProviderProps {- children: ReactNode;- identifier: string;- serverName?: Klavis.McpServerName;- type: IntegrationType;-}--export const DetailProvider = ({ children, type, identifier, serverName }: DetailProviderProps) => {- const { t } = useTranslation(['setting']);-- const config = useMemo((): KlavisServerType | LobehubSkillProviderType | undefined => {- if (type === 'klavis') {- return getKlavisServerByServerIdentifier(identifier);- }- return getLobehubSkillProviderById(identifier);- }, [type, identifier]);-- const klavisServers = useToolStore(klavisStoreSelectors.getServers);- const lobehubSkillServers = useToolStore(lobehubSkillStoreSelectors.getServers);-- const serverState = useMemo(() => {- if (type === 'klavis') {- return klavisServers.find((s) => s.identifier === identifier);- }- return lobehubSkillServers.find((s) => s.identifier === identifier);- }, [type, identifier, klavisServers, lobehubSkillServers]);-- const isConnected = useMemo(() => {- if (!serverState) return false;- if (type === 'klavis') {- return serverState.status === KlavisServerStatus.CONNECTED;- }- return serverState.status === LobehubSkillStatus.CONNECTED;- }, [type, serverState]);-- if (!config) return null;-- const { author, authorUrl, description, icon, introduction, label } = config;-- const i18nIdentifier =- type === 'klavis'- ? (config as KlavisServerType).identifier- : (config as LobehubSkillProviderType).id;- const i18nPrefix = type === 'klavis' ? 'tools.klavis.servers' : 'tools.lobehubSkill.providers';-- const localizedDescription = t(`${i18nPrefix}.${i18nIdentifier}.description`, {- defaultValue: description,- });- const localizedIntroduction = t(`${i18nPrefix}.${i18nIdentifier}.introduction`, {- defaultValue: introduction,- });-- const value: DetailContextValue = {- author,- authorUrl,- config,- description,- icon,- identifier,- introduction,- isConnected,- label,- localizedDescription,- localizedIntroduction,- serverName,- type,- };-- return <DetailContext.Provider value={value}>{children}</DetailContext.Provider>;-};diff --git a/src/features/SkillStore/IntegrationDetail/IntegrationDetailContent.tsx b/src/features/SkillStore/IntegrationDetail/IntegrationDetailContent.tsxdeleted file mode 100644index f255de08851..00000000000--- a/src/features/SkillStore/IntegrationDetail/IntegrationDetailContent.tsx+++ /dev/null@@ -1,51 +0,0 @@-'use client';--import { Flexbox } from '@lobehub/ui';-import type { Klavis } from 'klavis';-import { useState } from 'react';--import { useToolStore } from '@/store/tool';--import { DetailProvider, type IntegrationType } from './DetailProvider';-import Header from './Header';-import Nav, { type TabKey } from './Nav';-import Overview from './Overview';-import ToolList from './ToolList';--export type { IntegrationType } from './DetailProvider';--export interface IntegrationDetailContentProps {- identifier: string;- serverName?: Klavis.McpServerName;- type: IntegrationType;-}--export const IntegrationDetailContent = ({- type,- identifier,- serverName,-}: IntegrationDetailContentProps) => {- const [activeTab, setActiveTab] = useState<TabKey>('overview');-- // Fetch tools count for Nav badge (always fetch to show count in tab)- const useFetchServerTools = useToolStore((s) => s.useFetchServerTools);- const useFetchProviderTools = useToolStore((s) => s.useFetchProviderTools);-- const { data: klavisTools = [] } = useFetchServerTools(- type === 'klavis' ? serverName : undefined,- );- const { data: lobehubTools = [] } = useFetchProviderTools(- type === 'lobehub' ? identifier : undefined,- );- const toolsCount = type === 'klavis' ? klavisTools.length : lobehubTools.length;-- return (- <DetailProvider identifier={identifier} serverName={serverName} type={type}>- <Flexbox gap={16}>- <Header />- <Nav activeTab={activeTab} setActiveTab={setActiveTab} toolsCount={toolsCount} />- {activeTab === 'overview' ? <Overview /> : <ToolList />}- </Flexbox>- </DetailProvider>- );-};diff --git a/src/features/SkillStore/IntegrationDetail/index.tsx b/src/features/SkillStore/IntegrationDetail/index.tsxdeleted file mode 100644index 08dd7652ae8..00000000000--- a/src/features/SkillStore/IntegrationDetail/index.tsx+++ /dev/null@@ -1,30 +0,0 @@-'use client';--import { createModal } from '@lobehub/ui';-import { t } from 'i18next';-import type { Klavis } from 'klavis';--import { IntegrationDetailContent, type IntegrationType } from './IntegrationDetailContent';--export type { IntegrationType } from './IntegrationDetailContent';--export interface CreateIntegrationDetailModalOptions {- identifier: string;- serverName?: Klavis.McpServerName;- type: IntegrationType;-}--export const createIntegrationDetailModal = ({- identifier,- serverName,- type,-}: CreateIntegrationDetailModalOptions) =>- createModal({- children: (- <IntegrationDetailContent identifier={identifier} serverName={serverName} type={type} />- ),- destroyOnHidden: true,- footer: null,- title: t('dev.title.skillDetails', { ns: 'plugin' }),- width: 800,- });diff --git a/src/features/SkillStore/LobeHubList/index.tsx b/src/features/SkillStore/LobeHubList/index.tsxindex 59511c62c2c..3ccd4597c59 100644--- a/src/features/SkillStore/LobeHubList/index.tsx+++ b/src/features/SkillStore/LobeHubList/index.tsx@@ -11,7 +11,7 @@ import { KlavisServerStatus } from '@/store/tool/slices/klavisStore';import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types';import Empty from '../Empty';-import { createIntegrationDetailModal } from '../IntegrationDetail';+import { createKlavisSkillDetailModal, createLobehubSkillDetailModal } from '../SkillDetail';import { gridStyles } from '../style';import Item from './Item';@@ -95,9 +95,7 @@ export const LobeHubList = memo<LobeHubListProps>(({ keywords }) => {isConnected={isConnected}key={item.provider.id}label={item.provider.label}- onOpenDetail={() =>- createIntegrationDetailModal({ identifier: item.provider.id, type: 'lobehub' })- }+ onOpenDetail={() => createLobehubSkillDetailModal({ identifier: item.provider.id })}type="lobehub"/>);@@ -113,10 +111,9 @@ export const LobeHubList = memo<LobeHubListProps>(({ keywords }) => {key={item.serverType.identifier}label={item.serverType.label}onOpenDetail={() =>- createIntegrationDetailModal({+ createKlavisSkillDetailModal({identifier: item.serverType.identifier,serverName: item.serverType.serverName,- type: 'klavis',})}serverName={item.serverType.serverName}diff --git a/src/features/SkillStore/SkillDetail/DetailContext.tsx b/src/features/SkillStore/SkillDetail/DetailContext.tsxnew file mode 100644index 00000000000..9ecac7ea170--- /dev/null+++ b/src/features/SkillStore/SkillDetail/DetailContext.tsx@@ -0,0 +1,33 @@+'use client';++import type { KlavisServerType, LobehubSkillProviderType } from '@lobechat/const';+import type { Klavis } from 'klavis';+import type React from 'react';+import { createContext, useContext } from 'react';++export interface DetailContextValue {+ author: string;+ authorUrl?: string;+ config: KlavisServerType | LobehubSkillProviderType;+ description: string;+ icon: string | React.ComponentType<any>;+ identifier: string;+ introduction: string;+ isConnected: boolean;+ label: string;+ localizedDescription: string;+ localizedIntroduction: string;+ serverName?: Klavis.McpServerName;+ tools: Array<{ description?: string; inputSchema?: any; name: string }>;+ toolsLoading: boolean;+}++export const DetailContext = createContext<DetailContextValue | null>(null);++export const useDetailContext = () => {+ const context = useContext(DetailContext);+ if (!context) {+ throw new Error('useDetailContext must be used within DetailProvider');+ }+ return context;+};diff --git a/src/features/SkillStore/IntegrationDetail/Header.tsx b/src/features/SkillStore/SkillDetail/Header.tsxsimilarity index 91%rename from src/features/SkillStore/IntegrationDetail/Header.tsxrename to src/features/SkillStore/SkillDetail/Header.tsxindex 3e2de888832..805a06bc1a4 100644--- a/src/features/SkillStore/IntegrationDetail/Header.tsx+++ b/src/features/SkillStore/SkillDetail/Header.tsx@@ -9,13 +9,17 @@ import { useTranslation } from 'react-i18next';import { useSkillConnect } from '@/features/SkillStore/LobeHubList/useSkillConnect';-import { useDetailContext } from './DetailProvider';+import { useDetailContext } from './DetailContext';import { ICON_SIZE, styles } from './styles';-const Header = memo(() => {+interface HeaderProps {+ type: 'klavis' | 'lobehub';+}++const Header = memo<HeaderProps>(({ type }) => {const { t } = useTranslation(['setting']);const { close } = useModalContext();- const { type, identifier, serverName, icon, label, localizedDescription, isConnected } =+ const { identifier, serverName, icon, label, localizedDescription, isConnected } =useDetailContext();const {diff --git a/src/features/SkillStore/SkillDetail/KlavisDetailProvider.tsx b/src/features/SkillStore/SkillDetail/KlavisDetailProvider.tsxnew file mode 100644index 00000000000..75455693520--- /dev/null+++ b/src/features/SkillStore/SkillDetail/KlavisDetailProvider.tsx@@ -0,0 +1,74 @@+'use client';++import { getKlavisServerByServerIdentifier } from '@lobechat/const';+import type { Klavis } from 'klavis';+import type { ReactNode } from 'react';+import { useMemo } from 'react';+import { useTranslation } from 'react-i18next';++import { useToolStore } from '@/store/tool';+import { klavisStoreSelectors } from '@/store/tool/selectors';+import { KlavisServerStatus } from '@/store/tool/slices/klavisStore';++import { DetailContext, type DetailContextValue } from './DetailContext';++interface KlavisDetailProviderProps {+ children: ReactNode;+ identifier: string;+ serverName: Klavis.McpServerName;+}++export const KlavisDetailProvider = ({+ children,+ identifier,+ serverName,+}: KlavisDetailProviderProps) => {+ const { t } = useTranslation(['setting']);++ const config = useMemo(() => getKlavisServerByServerIdentifier(identifier), [identifier]);++ const klavisServers = useToolStore(klavisStoreSelectors.getServers);++ const serverState = useMemo(+ () => klavisServers.find((s) => s.identifier === identifier),+ [identifier, klavisServers],+ );++ const isConnected = useMemo(+ () => serverState?.status === KlavisServerStatus.CONNECTED,+ [serverState],+ );++ const useFetchServerTools = useToolStore((s) => s.useFetchServerTools);+ const { data: tools = [], isLoading: toolsLoading } = useFetchServerTools(serverName);++ if (!config) return null;++ const { author, authorUrl, description, icon, introduction, label } = config;++ const localizedDescription = t(`tools.klavis.servers.${identifier}.description`, {+ defaultValue: description,+ });+ const localizedIntroduction = t(`tools.klavis.servers.${identifier}.introduction`, {+ defaultValue: introduction,+ });++ const value: DetailContextValue = {+ author,+ authorUrl,+ config,+ description,+ icon,+ identifier,+ introduction,+ isConnected,+ label,+ localizedDescription,+ localizedIntroduction,+ serverName,+ tools,+ toolsLoading,+ };++ return <DetailContext.Provider value={value}>{children}</DetailContext.Provider>;+};diff --git a/src/features/SkillStore/SkillDetail/KlavisSkillDetailContent.tsx b/src/features/SkillStore/SkillDetail/KlavisSkillDetailContent.tsxnew file mode 100644index 00000000000..94e6b5adaa0--- /dev/null+++ b/src/features/SkillStore/SkillDetail/KlavisSkillDetailContent.tsx@@ -0,0 +1,33 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import type { Klavis } from 'klavis';+import { useState } from 'react';++import Header from './Header';+import { KlavisDetailProvider } from './KlavisDetailProvider';+import Nav, { type TabKey } from './Nav';+import Overview from './Overview';+import ToolList from './ToolList';++export interface KlavisSkillDetailContentProps {+ identifier: string;+ serverName: Klavis.McpServerName;+}++export const KlavisSkillDetailContent = ({+ identifier,+ serverName,+}: KlavisSkillDetailContentProps) => {+ const [activeTab, setActiveTab] = useState<TabKey>('overview');++ return (+ <KlavisDetailProvider identifier={identifier} serverName={serverName}>+ <Flexbox gap={16}>+ <Header type="klavis" />+ <Nav activeTab={activeTab} setActiveTab={setActiveTab} />+ {activeTab === 'overview' ? <Overview /> : <ToolList />}+ </Flexbox>+ </KlavisDetailProvider>+ );+};diff --git a/src/features/SkillStore/SkillDetail/LobehubDetailProvider.tsx b/src/features/SkillStore/SkillDetail/LobehubDetailProvider.tsxnew file mode 100644index 00000000000..4757a2e6f4a--- /dev/null+++ b/src/features/SkillStore/SkillDetail/LobehubDetailProvider.tsx@@ -0,0 +1,67 @@+'use client';++import { getLobehubSkillProviderById } from '@lobechat/const';+import type { ReactNode } from 'react';+import { useMemo } from 'react';+import { useTranslation } from 'react-i18next';++import { useToolStore } from '@/store/tool';+import { lobehubSkillStoreSelectors } from '@/store/tool/selectors';+import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types';++import { DetailContext, type DetailContextValue } from './DetailContext';++interface LobehubDetailProviderProps {+ children: ReactNode;+ identifier: string;+}++export const LobehubDetailProvider = ({ children, identifier }: LobehubDetailProviderProps) => {+ const { t } = useTranslation(['setting']);++ const config = useMemo(() => getLobehubSkillProviderById(identifier), [identifier]);++ const lobehubSkillServers = useToolStore(lobehubSkillStoreSelectors.getServers);++ const serverState = useMemo(+ () => lobehubSkillServers.find((s) => s.identifier === identifier),+ [identifier, lobehubSkillServers],+ );++ const isConnected = useMemo(+ () => serverState?.status === LobehubSkillStatus.CONNECTED,+ [serverState],+ );++ const useFetchProviderTools = useToolStore((s) => s.useFetchProviderTools);+ const { data: tools = [], isLoading: toolsLoading } = useFetchProviderTools(identifier);++ if (!config) return null;++ const { author, authorUrl, description, icon, introduction, label } = config;++ const localizedDescription = t(`tools.lobehubSkill.providers.${identifier}.description`, {+ defaultValue: description,+ });+ const localizedIntroduction = t(`tools.lobehubSkill.providers.${identifier}.introduction`, {+ defaultValue: introduction,+ });++ const value: DetailContextValue = {+ author,+ authorUrl,+ config,+ description,+ icon,+ identifier,+ introduction,+ isConnected,+ label,+ localizedDescription,+ localizedIntroduction,+ tools,+ toolsLoading,+ };++ return <DetailContext.Provider value={value}>{children}</DetailContext.Provider>;+};diff --git a/src/features/SkillStore/SkillDetail/LobehubSkillDetailContent.tsx b/src/features/SkillStore/SkillDetail/LobehubSkillDetailContent.tsxnew file mode 100644index 00000000000..30fb3a422ba--- /dev/null+++ b/src/features/SkillStore/SkillDetail/LobehubSkillDetailContent.tsx@@ -0,0 +1,28 @@+'use client';++import { Flexbox } from '@lobehub/ui';+import { useState } from 'react';++import Header from './Header';+import { LobehubDetailProvider } from './LobehubDetailProvider';+import Nav, { type TabKey } from './Nav';+import Overview from './Overview';+import ToolList from './ToolList';++export interface LobehubSkillDetailContentProps {+ identifier: string;+}++export const LobehubSkillDetailContent = ({ identifier }: LobehubSkillDetailContentProps) => {+ const [activeTab, setActiveTab] = useState<TabKey>('overview');++ return (+ <LobehubDetailProvider identifier={identifier}>+ <Flexbox gap={16}>+ <Header type="lobehub" />+ <Nav activeTab={activeTab} setActiveTab={setActiveTab} />+ {activeTab === 'overview' ? <Overview /> : <ToolList />}+ </Flexbox>+ </LobehubDetailProvider>+ );+};diff --git a/src/features/SkillStore/IntegrationDetail/Nav.tsx b/src/features/SkillStore/SkillDetail/Nav.tsxsimilarity index 86%rename from src/features/SkillStore/IntegrationDetail/Nav.tsxrename to src/features/SkillStore/SkillDetail/Nav.tsxindex 2803ce6e47d..6e61965b358 100644--- a/src/features/SkillStore/IntegrationDetail/Nav.tsx+++ b/src/features/SkillStore/SkillDetail/Nav.tsx@@ -5,6 +5,7 @@ import { BookOpenIcon, ListIcon } from 'lucide-react';import { memo } from 'react';import { useTranslation } from 'react-i18next';+import { useDetailContext } from './DetailContext';import { styles } from './styles';export type TabKey = 'overview' | 'tools';@@ -12,11 +13,12 @@ export type TabKey = 'overview' | 'tools';interface NavProps {activeTab: TabKey;setActiveTab: (tab: TabKey) => void;- toolsCount: number;}-const Nav = memo<NavProps>(({ activeTab, setActiveTab, toolsCount }) => {+const Nav = memo<NavProps>(({ activeTab, setActiveTab }) => {const { t } = useTranslation(['plugin']);+ const { tools } = useDetailContext();+ const toolsCount = tools.length;return (<Flexbox className={styles.nav}>diff --git a/src/features/SkillStore/IntegrationDetail/Overview.tsx b/src/features/SkillStore/SkillDetail/Overview.tsxsimilarity index 97%rename from src/features/SkillStore/IntegrationDetail/Overview.tsxrename to src/features/SkillStore/SkillDetail/Overview.tsxindex ed1453c7a94..fd8cd484924 100644--- a/src/features/SkillStore/IntegrationDetail/Overview.tsx+++ b/src/features/SkillStore/SkillDetail/Overview.tsx@@ -5,7 +5,7 @@ import { ExternalLink } from 'lucide-react';import { memo } from 'react';import { useTranslation } from 'react-i18next';-import { useDetailContext } from './DetailProvider';+import { useDetailContext } from './DetailContext';import { styles } from './styles';const Overview = memo(() => {diff --git a/src/features/SkillStore/IntegrationDetail/ToolList.tsx b/src/features/SkillStore/SkillDetail/ToolList.tsxsimilarity index 70%rename from src/features/SkillStore/IntegrationDetail/ToolList.tsxrename to src/features/SkillStore/SkillDetail/ToolList.tsxindex bfb708a5cd0..7c46210a6b6 100644--- a/src/features/SkillStore/IntegrationDetail/ToolList.tsx+++ b/src/features/SkillStore/SkillDetail/ToolList.tsx@@ -5,37 +5,15 @@ import { Loader2, Wrench } from 'lucide-react';import { memo, useState } from 'react';import { useTranslation } from 'react-i18next';-import { useToolStore } from '@/store/tool';--import { useDetailContext } from './DetailProvider';+import { useDetailContext } from './DetailContext';import { styles } from './styles';-interface ToolItem {- description?: string;- inputSchema?: any;- name: string;-}-const ToolList = memo(() => {const { t } = useTranslation(['plugin', 'discover']);- const { type, identifier, serverName } = useDetailContext();+ const { tools, toolsLoading } = useDetailContext();const [activeKey, setActiveKey] = useState<string[]>([]);- // Fetch tools using SWR hooks from store- const useFetchServerTools = useToolStore((s) => s.useFetchServerTools);- const useFetchProviderTools = useToolStore((s) => s.useFetchProviderTools);-- const { data: klavisTools = [], isLoading: klavisToolsLoading } = useFetchServerTools(- type === 'klavis' ? serverName : undefined,- );- const { data: lobehubTools = [], isLoading: lobehubToolsLoading } = useFetchProviderTools(- type === 'lobehub' ? identifier : undefined,- );-- const tools: ToolItem[] = type === 'klavis' ? klavisTools : lobehubTools;- const isLoading = type === 'klavis' ? klavisToolsLoading : lobehubToolsLoading;-- if (isLoading) {+ if (toolsLoading) {return (<Flexbox align="center" justify="center" style={{ minHeight: 200 }}><Icon icon={Loader2} size={24} spin />diff --git a/src/features/SkillStore/SkillDetail/index.tsx b/src/features/SkillStore/SkillDetail/index.tsxnew file mode 100644index 00000000000..1b0703b78ce--- /dev/null+++ b/src/features/SkillStore/SkillDetail/index.tsx@@ -0,0 +1,40 @@+'use client';++import { createModal } from '@lobehub/ui';+import { t } from 'i18next';+import type { Klavis } from 'klavis';++import { KlavisSkillDetailContent } from './KlavisSkillDetailContent';+import { LobehubSkillDetailContent } from './LobehubSkillDetailContent';++export interface CreateKlavisSkillDetailModalOptions {+ identifier: string;+ serverName: Klavis.McpServerName;+}++export const createKlavisSkillDetailModal = ({+ identifier,+ serverName,+}: CreateKlavisSkillDetailModalOptions) =>+ createModal({+ children: <KlavisSkillDetailContent identifier={identifier} serverName={serverName} />,+ destroyOnHidden: true,+ footer: null,+ title: t('dev.title.skillDetails', { ns: 'plugin' }),+ width: 800,+ });++export interface CreateLobehubSkillDetailModalOptions {+ identifier: string;+}++export const createLobehubSkillDetailModal = ({+ identifier,+}: CreateLobehubSkillDetailModalOptions) =>+ createModal({+ children: <LobehubSkillDetailContent identifier={identifier} />,+ destroyOnHidden: true,+ footer: null,+ title: t('dev.title.skillDetails', { ns: 'plugin' }),+ width: 800,+ });diff --git a/src/features/SkillStore/IntegrationDetail/styles.ts b/src/features/SkillStore/SkillDetail/styles.tssimilarity index 100%rename from src/features/SkillStore/IntegrationDetail/styles.tsrename to src/features/SkillStore/SkillDetail/styles.ts