| 1 |
<script setup lang="ts"> |
| 2 |
import { defineProps, withDefaults } from "vue"; |
| 3 |
|
| 4 |
import Icon from "@/components/Icon/Icon.vue"; |
| 5 |
import { copyString } from "@/utils/helpers"; |
| 6 |
|
| 7 |
interface Props { |
| 8 |
link: string; |
| 9 |
} |
| 10 |
|
| 11 |
withDefaults(defineProps<Props>(), {}); |
| 12 |
</script> |
| 13 |
|
| 14 |
<template> |
| 15 |
<div |
| 16 |
class="copy-field" |
| 17 |
@click="copyString(link)" |
| 18 |
> |
| 19 |
<span class="copy-field__link">{{ link }}</span> |
| 20 |
<Icon |
| 21 |
name="icon-content-copy" |
| 22 |
color="primary" |
| 23 |
/> |
| 24 |
</div> |
| 25 |
</template> |
| 26 |
|
| 27 |
<style lang="scss" scoped> |
| 28 |
.copy-field { |
| 29 |
display: flex; |
| 30 |
cursor: pointer; |
| 31 |
justify-content: space-between; |
| 32 |
padding: 12px 16px; |
| 33 |
border-radius: 8px; |
| 34 |
word-wrap: break-word; |
| 35 |
align-items: center; |
| 36 |
background: var(--gray-light); |
| 37 |
|
| 38 |
&__link { |
| 39 |
flex: 1 1 auto; |
| 40 |
color: var(--gray); |
| 41 |
overflow-wrap: anywhere; |
| 42 |
} |
| 43 |
} |
| 44 |
</style> |
| 45 |
|