2 import { BadgeInfo } from '$lib/components/app';
3 import * as Tooltip from '$lib/components/ui/tooltip';
4 import { copyToClipboard } from '$lib/utils';
5 import type { Component } from 'svelte';
10 value: string | number;
11 tooltipLabel?: string;
14 let { class: className = '', icon: IconComponent, value, tooltipLabel }: Props = $props();
16 function handleClick() {
17 void copyToClipboard(String(value));
24 <!-- prevent another nested button element -->
25 {#snippet child({ props })}
26 <BadgeInfo {...props} class={className} onclick={handleClick}>
28 <IconComponent class="h-3 w-3" />
40 <BadgeInfo class={className} onclick={handleClick}>
42 <IconComponent class="h-3 w-3" />