Skip to content

Commit

Permalink
fix: addressing prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Mozolevsky authored and Dmitry Mozolevsky committed Aug 2, 2024
1 parent d33823d commit c4da607
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/ui/src/core_components/base/BaseControlBar.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<template>
<div class="BaseControlBar">
<button
v-if="props.copyStructuredContent"
<button
v-if="props.copyStructuredContent"
class="control-button"
@click="copyToClipboard({ text: props.copyStructuredContent })"
>
Copy JSON
</button>
<button
v-if="props.copyRawContent"
<button
v-if="props.copyRawContent"
class="control-button"
@click="copyToClipboard({ text: props.copyRawContent })">
@click="copyToClipboard({ text: props.copyRawContent })"
>
Copy
</button>
</div>
Expand All @@ -22,16 +23,12 @@ const props = defineProps<{
copyStructuredContent?: string;
}>();
function copyToClipboard({
text = "",
}: {
function copyToClipboard({ text = "" }: {
text?: string;
}) {
try {
navigator.clipboard.writeText(text);
} catch (error) {
console.error(error.message);
}
} catch (error) {}
}
</script>

Expand Down

0 comments on commit c4da607

Please sign in to comment.