diff --git a/apps/nextjs/src/app/[locale]/manage/tools/api/components/mcp-instructions.tsx b/apps/nextjs/src/app/[locale]/manage/tools/api/components/mcp-instructions.tsx index 6c862cdb0..9288448e5 100644 --- a/apps/nextjs/src/app/[locale]/manage/tools/api/components/mcp-instructions.tsx +++ b/apps/nextjs/src/app/[locale]/manage/tools/api/components/mcp-instructions.tsx @@ -11,18 +11,10 @@ import { Button, Code, CopyButton, - Divider, Group, List, ListItem, Stack, - Table, - TableScrollContainer, - TableTbody, - TableTd, - TableTh, - TableThead, - TableTr, Text, ThemeIcon, Title, @@ -41,7 +33,6 @@ import { IconTools, IconWorld, } from "@tabler/icons-react"; -import { useMediaQuery } from "@mantine/hooks"; import { clientApi } from "@homarr/api/client"; import { revalidatePathActionAsync } from "@homarr/common/client"; @@ -50,6 +41,7 @@ import { useScopedI18n } from "@homarr/translation/client"; import { CopyApiKeyModal } from "./copy-api-key-modal"; import type { McpToolGroup } from "./api-page-tabs"; +import classes from "./mcp-tools-accordion.module.css"; const toolTypeDisplay: Record<"query" | "mutation", { color: string; method: string }> = { query: { color: "blue", method: "GET" }, @@ -64,7 +56,6 @@ interface McpInstructionsProps { export function McpInstructions({ baseUrl, hasApiKeys, toolGroups }: McpInstructionsProps) { const t = useScopedI18n("management.page.tool.api.tab.mcp"); - const isDesktop = useMediaQuery("(min-width: 48em)"); const { openModal } = useModalAction(CopyApiKeyModal); const { mutate: createApiKey, isPending } = clientApi.apiKeys.create.useMutation({ async onSuccess(data) { @@ -296,114 +287,34 @@ export function McpInstructions({ baseUrl, hasApiKeys, toolGroups }: McpInstruct count: String(toolGroups.reduce((sum, g) => sum + g.tools.length, 0)), })} - - - - - {isDesktop && {t("availableTools.columnType")}} - {t("availableTools.columnName")} - {t("availableTools.columnDescription")} - - - - {toolGroups.flatMap((group) => - group.tools.map((tool) => ( - - {isDesktop && ( - - - {toolTypeDisplay[tool.type].method} - - - )} - - - {tool.name} - - - - - {tool.description} - - - - )), - )} - -
-
+ + {toolGroups.map((group) => ( + + + + {group.namespace} + {group.tools.length} + + + + + {group.tools.map((tool) => ( +
+ + {toolTypeDisplay[tool.type].method} + +
+ {tool.name} + {tool.description} +
+
+ ))} +
+
+
+ ))} +
- - - - - - - - - - {t("troubleshooting.title")} - - - - - -
- - {t("troubleshooting.missingHeader.title")} - - - {t("troubleshooting.missingHeader.description", { - header: "ApiKey", - section: "headers", - })} - -
-
- - {t("troubleshooting.invalidFormat.title")} - - - {t("troubleshooting.invalidFormat.description")} - -
-
- - {t("troubleshooting.invalidKey.title")} - - - {t("troubleshooting.invalidKey.description")} - -
-
- - {t("troubleshooting.connectionRefused.title")} - - - {t("troubleshooting.connectionRefused.description", { - localhost: "localhost", - })} - -
-
- - {t("troubleshooting.toolsNotAppearing.title")} - - - {t("troubleshooting.toolsNotAppearing.description")} - -
-
-
-
-
); } diff --git a/apps/nextjs/src/app/[locale]/manage/tools/api/components/mcp-tools-accordion.module.css b/apps/nextjs/src/app/[locale]/manage/tools/api/components/mcp-tools-accordion.module.css new file mode 100644 index 000000000..9cb951b52 --- /dev/null +++ b/apps/nextjs/src/app/[locale]/manage/tools/api/components/mcp-tools-accordion.module.css @@ -0,0 +1,6 @@ +.toolRow { + display: grid; + grid-template-columns: 42px 1fr; + align-items: first baseline; + gap: var(--mantine-spacing-xs); +}