File size: 935 Bytes
a03b3ba |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
<script lang="ts">
export let textSize: { tokenName: string; value: string };
let copied = false;
</script>
<tr>
<td class="token-name"><pre>{textSize.tokenName}</pre></td>
<td><pre>{textSize.value}</pre></td>
<td class="td-button">
<button
on:click={() => {
copied = true;
navigator.clipboard.writeText(textSize.tokenName);
setTimeout(() => {
copied = false;
}, 1000);
}}
><div style="font-size: {textSize.value}">Gradio</div>
<div class="copy-text">
{copied ? "Copied to clipboard!" : "Copy token"}
</div>
</button>
</td>
</tr>
<style>
.td-button {
width: 100%;
}
.copy-text {
background-color: rgb(255 255 255 / 68%);
font-size: 0.8em;
width: fit-content;
margin: 0 auto;
padding: 5px 10px;
border-radius: 10px;
color: #8d9196;
}
button {
border: none;
width: 100%;
cursor: pointer;
background-color: white;
}
td {
padding: 10px;
}
</style>
|