feat: Improve statistic badges

This commit is contained in:
Aleksander Grygier 2025-11-27 14:12:21 +01:00
parent d73353732f
commit 9086bc30bd
2 changed files with 7 additions and 6 deletions

View File

@ -260,11 +260,7 @@
disabled={isLoading()}
/>
{:else}
<BadgeModelName
model={displayedModel() || undefined}
onclick={handleCopyModel}
showCopyIcon={true}
/>
<BadgeModelName model={displayedModel() || undefined} onclick={handleCopyModel} />
{/if}
{#if currentConfig.showMessageStats && message.timings && message.timings.predicted_n && message.timings.predicted_ms}

View File

@ -1,5 +1,6 @@
<script lang="ts">
import { BadgeInfo } from '$lib/components/app';
import { copyToClipboard } from '$lib/utils/copy';
import type { Component } from 'svelte';
interface Props {
@ -9,9 +10,13 @@
}
let { class: className = '', icon: Icon, value }: Props = $props();
function handleClick() {
void copyToClipboard(String(value));
}
</script>
<BadgeInfo class={className}>
<BadgeInfo class={className} onclick={handleClick}>
{#snippet icon()}
<Icon class="h-3 w-3" />
{/snippet}