|
46 | 46 | <Modal on:close={() => goto(previousPage)} width="min-w-xl">
|
47 | 47 | <div class="w-full min-w-64 p-8">
|
48 | 48 | <div class="flex h-full flex-col gap-2">
|
49 |
| - <div class="flex gap-6"> |
50 |
| - <ToolLogo color={data.tool.color} icon={data.tool.icon} size="lg" /> |
| 49 | + <div class="flex flex-col sm:flex-row sm:gap-6"> |
| 50 | + <div class="mb-4 flex justify-center sm:mb-0"> |
| 51 | + <ToolLogo color={data.tool.color} icon={data.tool.icon} size="lg" /> |
| 52 | + </div> |
51 | 53 |
|
52 | 54 | <div class="flex-1">
|
53 |
| - <div> |
54 |
| - <h1 class="mr-1 inline text-xl font-semibold"> |
| 55 | + <div class="flex flex-wrap items-center gap-2"> |
| 56 | + <h1 class="break-words text-xl font-semibold"> |
55 | 57 | {data.tool.displayName}
|
56 | 58 | </h1>
|
57 |
| - <span class="ml-1 rounded-full border px-2 py-0.5 text-sm leading-none text-gray-500" |
| 59 | + <span class="inline rounded-full border px-2 py-0.5 text-sm leading-none text-gray-500" |
58 | 60 | >public</span
|
59 | 61 | >
|
60 | 62 | </div>
|
61 | 63 |
|
62 | 64 | {#if data.tool?.baseUrl}
|
63 | 65 | {#if data.tool.baseUrl.startsWith("https://")}
|
64 |
| - <p class="mb-2 line-clamp-2 font-mono text-gray-500"> |
| 66 | + <p class="mb-2 break-words font-mono text-gray-500"> |
65 | 67 | {data.tool.baseUrl}
|
66 | 68 | </p>
|
67 | 69 | {:else}
|
68 | 70 | <a
|
69 | 71 | href="https://huggingface.co/spaces/{data.tool.baseUrl}"
|
70 | 72 | target="_blank"
|
71 |
| - class="mb-2 line-clamp-2 font-mono text-gray-500 hover:underline" |
| 73 | + class="mb-2 break-words font-mono text-gray-500 hover:underline" |
72 | 74 | >
|
73 | 75 | {data.tool.baseUrl}
|
74 | 76 | </a>
|
|
91 | 93 | {/if}
|
92 | 94 |
|
93 | 95 | <div
|
94 |
| - class="flex items-center gap-4 whitespace-nowrap text-sm text-gray-500 hover:*:text-gray-800" |
| 96 | + class="flex flex-wrap items-center justify-center gap-x-4 gap-y-2 whitespace-nowrap text-sm text-gray-500 hover:*:text-gray-800" |
95 | 97 | >
|
96 |
| - <button |
97 |
| - class="{isActive |
98 |
| - ? 'bg-gray-100 text-gray-800' |
99 |
| - : 'bg-black !text-white'} my-2 flex w-fit items-center rounded-full px-3 py-1 text-base" |
100 |
| - name="Activate model" |
101 |
| - on:click|stopPropagation={() => { |
102 |
| - if (isActive) { |
103 |
| - settings.instantSet({ |
104 |
| - tools: ($settings?.tools ?? []).filter((t) => t !== data.tool._id), |
105 |
| - }); |
106 |
| - } else { |
107 |
| - settings.instantSet({ |
108 |
| - tools: [...($settings?.tools ?? []), data.tool._id], |
109 |
| - }); |
110 |
| - } |
111 |
| - }} |
112 |
| - > |
113 |
| - {isActive ? "Deactivate" : "Activate"} |
114 |
| - </button> |
| 98 | + <div class="w-full sm:w-auto"> |
| 99 | + <button |
| 100 | + class="{isActive |
| 101 | + ? 'bg-gray-100 text-gray-800' |
| 102 | + : 'bg-black !text-white'} mx-auto my-2 flex w-full w-min items-center justify-center rounded-full px-3 py-1 text-base" |
| 103 | + name="Activate model" |
| 104 | + on:click|stopPropagation={() => { |
| 105 | + if (isActive) { |
| 106 | + settings.instantSet({ |
| 107 | + tools: ($settings?.tools ?? []).filter((t) => t !== data.tool._id), |
| 108 | + }); |
| 109 | + } else { |
| 110 | + settings.instantSet({ |
| 111 | + tools: [...($settings?.tools ?? []), data.tool._id], |
| 112 | + }); |
| 113 | + } |
| 114 | + }} |
| 115 | + > |
| 116 | + {isActive ? "Deactivate" : "Activate"} |
| 117 | + </button> |
| 118 | + </div> |
115 | 119 | {#if data.tool?.createdByMe}
|
116 | 120 | <a href="{base}/tools/{data.tool?._id}/edit" class="underline"
|
117 | 121 | ><CarbonPen class="mr-1.5 inline text-xs" />Edit
|
|
182 | 186 | </div>
|
183 | 187 | </div>
|
184 | 188 | </div>
|
185 |
| - |
186 |
| - <p class="text-sm"> |
| 189 | + <p class="text-sm max-sm:hidden"> |
187 | 190 | Tools are applications that the model can choose to call while you are chatting with it.
|
188 | 191 | </p>
|
189 | 192 | {#if data.tool.description}
|
|
197 | 200 | <h2 class="text-lg font-semibold">Direct URL</h2>
|
198 | 201 |
|
199 | 202 | <p class="pb-2 text-sm text-gray-500">Share this link with people to use your tool.</p>
|
200 |
| - |
201 | 203 | <div
|
202 |
| - class="flex flex-row gap-2 rounded-lg border-2 border-gray-200 bg-gray-100 py-2 pl-3 pr-1.5" |
| 204 | + class="flex flex-row items-center gap-2 rounded-lg border-2 border-gray-200 bg-gray-100 py-2 pl-3 pr-1.5" |
203 | 205 | >
|
204 |
| - <input disabled class="flex-1 truncate bg-inherit" value={shareUrl} /> |
205 |
| - <CopyToClipBoardBtn |
206 |
| - value={shareUrl} |
207 |
| - classNames="!border-none !shadow-none !py-0 !px-1 !rounded-md" |
208 |
| - > |
209 |
| - <div class="flex items-center gap-1.5 text-gray-500 hover:underline"> |
210 |
| - <CarbonLink />Copy |
| 206 | + <div class="relative flex-1 overflow-hidden"> |
| 207 | + <input disabled class="w-full truncate bg-inherit pr-16" value={shareUrl} /> |
| 208 | + <div class="absolute right-0 top-1/2 -translate-y-1/2"> |
| 209 | + <CopyToClipBoardBtn |
| 210 | + value={shareUrl} |
| 211 | + classNames="!border-none !shadow-none !py-0 !px-1 !rounded-md" |
| 212 | + > |
| 213 | + <div class="flex items-center gap-1.5 text-gray-500 hover:underline"> |
| 214 | + <CarbonLink />Copy |
| 215 | + </div> |
| 216 | + </CopyToClipBoardBtn> |
211 | 217 | </div>
|
212 |
| - </CopyToClipBoardBtn> |
| 218 | + </div> |
213 | 219 | </div>
|
214 | 220 | </div>
|
215 | 221 | </div>
|
|
0 commit comments