Skip to content

Commit 8400090

Browse files
committed
Refactor MCP icon and update app name usage
Extracted the MCP icon into a reusable IconMCP.svelte component and replaced inline SVG usage in MCPServerManager.svelte. Updated references to 'HuggingChat' to use the dynamic PUBLIC_APP_NAME from public config for better branding flexibility.
1 parent c59cd7a commit 8400090

File tree

2 files changed

+35
-19
lines changed

2 files changed

+35
-19
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<script lang="ts">
2+
interface Props {
3+
classNames?: string;
4+
}
5+
6+
let { classNames = "" }: Props = $props();
7+
</script>
8+
9+
<svg
10+
xmlns="http://www.w3.org/2000/svg"
11+
class={classNames}
12+
width="1em"
13+
height="1em"
14+
viewBox="0 0 24 24"
15+
>
16+
<g
17+
fill="none"
18+
stroke="currentColor"
19+
stroke-linecap="round"
20+
stroke-linejoin="round"
21+
stroke-width="1.5"
22+
>
23+
<path
24+
d="m3.5 11.75l8.172-8.171a2.828 2.828 0 1 1 4 4m0 0L9.5 13.75m6.172-6.171a2.828 2.828 0 0 1 4 4l-6.965 6.964a1 1 0 0 0 0 1.414L14 21.25"
25+
/>
26+
<path d="m17.5 9.75l-6.172 6.171a2.829 2.829 0 0 1-4-4L13.5 5.749" />
27+
</g>
28+
</svg>

src/lib/components/mcp/MCPServerManager.svelte

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
23
import Modal from "$lib/components/Modal.svelte";
34
import ServerCard from "./ServerCard.svelte";
45
import AddServerForm from "./AddServerForm.svelte";
@@ -13,6 +14,9 @@
1314
import IconAddLarge from "~icons/carbon/add-large";
1415
import IconRefresh from "~icons/carbon/renew";
1516
import IconTools from "~icons/carbon/tools";
17+
import IconMCP from "$lib/components/icons/IconMCP.svelte";
18+
19+
const publicConfig = usePublicConfig();
1620
1721
interface Props {
1822
onclose: () => void;
@@ -54,9 +58,9 @@
5458
</h2>
5559
<p class="text-sm text-gray-600 dark:text-gray-400">
5660
{#if currentView === "list"}
57-
Manage MCP servers to extend HuggingChat with external tools.
61+
Manage MCP servers to extend {publicConfig.PUBLIC_APP_NAME} with external tools.
5862
{:else}
59-
Add a custom MCP server to the application
63+
Add a custom MCP server to {publicConfig.PUBLIC_APP_NAME}.
6064
{/if}
6165
</p>
6266
</div>
@@ -73,23 +77,7 @@
7377
class="flex size-10 items-center justify-center rounded-xl bg-blue-500/10"
7478
class:grayscale={!enabledCount}
7579
>
76-
<svg
77-
xmlns="http://www.w3.org/2000/svg"
78-
width="1em"
79-
height="1em"
80-
viewBox="0 0 24 24"
81-
class="size-8 text-blue-600 dark:text-blue-500"
82-
><!-- Icon from Huge Icons by Hugeicons - undefined --><g
83-
fill="none"
84-
stroke="currentColor"
85-
stroke-linecap="round"
86-
stroke-linejoin="round"
87-
stroke-width="1.5"
88-
><path
89-
d="m3.5 11.75l8.172-8.171a2.828 2.828 0 1 1 4 4m0 0L9.5 13.75m6.172-6.171a2.828 2.828 0 0 1 4 4l-6.965 6.964a1 1 0 0 0 0 1.414L14 21.25"
90-
/><path d="m17.5 9.75l-6.172 6.171a2.829 2.829 0 0 1-4-4L13.5 5.749" /></g
91-
></svg
92-
>
80+
<IconMCP classNames="size-8 text-blue-600 dark:text-blue-500" />
9381
</div>
9482
<div>
9583
<p class="text-sm font-medium text-gray-900 dark:text-gray-100">

0 commit comments

Comments
 (0)