|
13 | 13 | import IconAddLarge from "~icons/carbon/add-large"; |
14 | 14 | import IconRefresh from "~icons/carbon/renew"; |
15 | 15 | import IconTools from "~icons/carbon/tools"; |
16 | | - // Warning moved into AddServerForm to appear after headers |
17 | 16 |
|
18 | 17 | interface Props { |
19 | 18 | onclose: () => void; |
|
42 | 41 | } |
43 | 42 | </script> |
44 | 43 |
|
45 | | -<Modal width="w-[600px]" {onclose} closeButton> |
| 44 | +<Modal width={currentView === "list" ? "w-[800px]" : "w-[600px]"} {onclose} closeButton> |
46 | 45 | <div class="p-6"> |
47 | 46 | <!-- Header --> |
48 | 47 | <div class="mb-6"> |
49 | | - <h2 class="mb-2 text-xl font-semibold text-gray-900 dark:text-gray-200"> |
| 48 | + <h2 class="mb-1 text-xl font-semibold text-gray-900 dark:text-gray-200"> |
50 | 49 | {#if currentView === "list"} |
51 | 50 | MCP Servers |
52 | 51 | {:else} |
|
55 | 54 | </h2> |
56 | 55 | <p class="text-sm text-gray-600 dark:text-gray-400"> |
57 | 56 | {#if currentView === "list"} |
58 | | - Manage MCP servers to extend your assistant with external tools. |
| 57 | + Manage MCP servers to extend HuggingChat with external tools. |
59 | 58 | {:else} |
60 | 59 | Add a custom MCP server to the application |
61 | 60 | {/if} |
|
65 | 64 | <!-- Content --> |
66 | 65 | {#if currentView === "list"} |
67 | 66 | <div |
68 | | - class="mb-6 flex items-center justify-between rounded-lg bg-blue-50 p-4 dark:bg-blue-900/10" |
| 67 | + class="mb-6 flex items-center justify-between rounded-lg p-4 {!enabledCount |
| 68 | + ? 'bg-gray-100 dark:bg-white/5' |
| 69 | + : 'bg-blue-50 dark:bg-blue-900/10'}" |
69 | 70 | > |
70 | | - <div class="flex items-center gap-2"> |
71 | | - <IconTools class="size-5 text-blue-600 dark:text-blue-400" /> |
| 71 | + <div class="flex items-center gap-3"> |
| 72 | + <div |
| 73 | + class="flex size-10 items-center justify-center rounded-xl bg-blue-500/10" |
| 74 | + class:grayscale={!enabledCount} |
| 75 | + > |
| 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 | + > |
| 93 | + </div> |
72 | 94 | <div> |
73 | 95 | <p class="text-sm font-medium text-gray-900 dark:text-gray-100"> |
74 | 96 | {$allMcpServers.length} |
|
97 | 119 | </button> |
98 | 120 | </div> |
99 | 121 | </div> |
100 | | - <div class="space-y-6"> |
| 122 | + <div class="space-y-5"> |
101 | 123 | <!-- Base Servers --> |
102 | 124 | {#if baseServers.length > 0} |
103 | 125 | <div> |
104 | 126 | <h3 class="mb-3 text-sm font-medium text-gray-700 dark:text-gray-300"> |
105 | 127 | Base Servers ({baseServers.length}) |
106 | 128 | </h3> |
107 | | - <div class="space-y-3"> |
| 129 | + <div class="grid grid-cols-1 gap-3 md:grid-cols-2"> |
108 | 130 | {#each baseServers as server (server.id)} |
109 | 131 | <ServerCard {server} isSelected={$selectedServerIds.has(server.id)} /> |
110 | 132 | {/each} |
|
122 | 144 | class="flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-300 p-8 dark:border-gray-700" |
123 | 145 | > |
124 | 146 | <IconTools class="mb-3 size-12 text-gray-400" /> |
125 | | - <p class="mb-2 text-sm font-medium text-gray-900 dark:text-gray-100"> |
| 147 | + <p class="mb-1 text-sm font-medium text-gray-900 dark:text-gray-100"> |
126 | 148 | No custom servers yet |
127 | 149 | </p> |
128 | 150 | <p class="mb-4 text-xs text-gray-600 dark:text-gray-400"> |
|
137 | 159 | </button> |
138 | 160 | </div> |
139 | 161 | {:else} |
140 | | - <div class="space-y-3"> |
| 162 | + <div class="grid grid-cols-1 gap-3 md:grid-cols-2"> |
141 | 163 | {#each customServers as server (server.id)} |
142 | 164 | <ServerCard {server} isSelected={$selectedServerIds.has(server.id)} /> |
143 | 165 | {/each} |
|
0 commit comments