Update behaviour for copying bindings

This commit is contained in:
Andrew Kingston 2025-01-20 16:04:39 +00:00
parent 034369119c
commit 97447981dc
No known key found for this signature in database
1 changed files with 7 additions and 7 deletions

View File

@ -75,6 +75,9 @@
if (isObject) {
return Colors.Object
}
if (value instanceof Date) {
return Colors.Date
}
switch (value) {
case undefined:
return Colors.Undefined
@ -91,15 +94,12 @@
case "number":
return Colors.Number
}
if (value instanceof Date) {
return Colors.Date
}
return Colors.Other
}
const copyValue = () => {
Helpers.copyToClipboard(JSON.stringify(value))
notifications.success("Value copied to clipboard")
const copyBinding = () => {
Helpers.copyToClipboard(readableBinding)
notifications.success("Binding copied to clipboard")
}
</script>
@ -143,7 +143,7 @@
hoverable
color="var(--spectrum-global-color-gray-600)"
hoverColor="var(--spectrum-global-color-gray-900)"
on:click={copyValue}
on:click={copyBinding}
/>
</div>
</div>