Add CopyValue

This commit is contained in:
Jonathan Staab 2023-04-05 15:08:24 -05:00
parent 79dde724df
commit dadc93b28a

View File

@ -0,0 +1,18 @@
<script lang="ts">
import {copyToClipboard} from "src/util/html"
import {toast} from "src/app/ui"
export let label
export let value
const copy = () => {
copyToClipboard(value)
toast.show("info", `${label} copied to clipboard!`)
}
</script>
<strong>{label}</strong>
<div class="flex items-center gap-2 font-mono text-sm">
<i class="fa-solid fa-copy cursor-pointer" on:click={copy} />
{value.length > 80 ? value.slice(0, 50) + "..." : value}
</div>