Change copy btn style (#36)
Browse files
src/lib/components/InferencePlayground/InferencePlaygroundCodeSnippets.svelte
CHANGED
@@ -252,17 +252,10 @@ print(output.choices[0].message)`
|
|
252 |
</div>
|
253 |
|
254 |
{#each snippetsByLanguage[selectedLanguage] as { label, code, language }}
|
255 |
-
<div class="px-4 pb-4 pt-6">
|
256 |
<h2 class="font-semibold">{label}</h2>
|
257 |
-
</div>
|
258 |
-
<div class="group relative">
|
259 |
-
<pre
|
260 |
-
class="overflow-x-auto rounded-lg border border-gray-200/80 bg-white px-4 py-6 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-800/50">{@html highlight(
|
261 |
-
code,
|
262 |
-
language ?? selectedLanguage
|
263 |
-
)}</pre>
|
264 |
<button
|
265 |
-
class="
|
266 |
on:click={(e) => {
|
267 |
const el = e.currentTarget;
|
268 |
el.classList.add('text-green-500');
|
@@ -275,8 +268,13 @@ print(output.choices[0].message)`
|
|
275 |
}, 1000);
|
276 |
}}
|
277 |
>
|
278 |
-
<IconCopyCode />
|
279 |
</button>
|
280 |
</div>
|
|
|
|
|
|
|
|
|
|
|
281 |
{/each}
|
282 |
</div>
|
|
|
252 |
</div>
|
253 |
|
254 |
{#each snippetsByLanguage[selectedLanguage] as { label, code, language }}
|
255 |
+
<div class="flex items-center justify-between px-4 pb-4 pt-6">
|
256 |
<h2 class="font-semibold">{label}</h2>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
<button
|
258 |
+
class="flex items-center gap-x-1.5 rounded-md bg-gray-200 px-1.5 py-0.5 transition dark:bg-gray-950"
|
259 |
on:click={(e) => {
|
260 |
const el = e.currentTarget;
|
261 |
el.classList.add('text-green-500');
|
|
|
268 |
}, 1000);
|
269 |
}}
|
270 |
>
|
271 |
+
<IconCopyCode /> Copy code
|
272 |
</button>
|
273 |
</div>
|
274 |
+
<pre
|
275 |
+
class="overflow-x-auto rounded-lg border border-gray-200/80 bg-white px-4 py-6 text-sm shadow-sm dark:border-gray-800 dark:bg-gray-800/50">{@html highlight(
|
276 |
+
code,
|
277 |
+
language ?? selectedLanguage
|
278 |
+
)}</pre>
|
279 |
{/each}
|
280 |
</div>
|