2021-11-25 11:09:37 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
// Copyright © 2021 Hardcore Engineering Inc.
|
|
|
|
//
|
|
|
|
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
//
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
2022-09-21 08:08:25 +00:00
|
|
|
import type { IntlString, Asset } from '@hcengineering/platform'
|
|
|
|
import { CircleButton, closeTooltip, Label } from '@hcengineering/ui'
|
2021-11-25 11:09:37 +00:00
|
|
|
import IconCopy from './icons/Copy.svelte'
|
|
|
|
|
|
|
|
interface Item {
|
2022-04-29 05:27:17 +00:00
|
|
|
label: IntlString
|
|
|
|
icon: Asset
|
2021-11-25 11:09:37 +00:00
|
|
|
value: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export let value: Item
|
|
|
|
|
|
|
|
const copyLink = (): void => {
|
2022-04-29 05:27:17 +00:00
|
|
|
navigator.clipboard.writeText(value.value)
|
|
|
|
// .then(() => {
|
|
|
|
// console.log('Copied!', value.value)
|
|
|
|
// })
|
|
|
|
// .catch((err) => {
|
|
|
|
// console.log('Something went wrong', err)
|
|
|
|
// })
|
2021-11-25 11:09:37 +00:00
|
|
|
closeTooltip()
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class="flex-row-center">
|
|
|
|
<CircleButton icon={value.icon} size={'x-large'} />
|
2022-02-09 09:20:30 +00:00
|
|
|
<div class="flex-col caption-color clear-mins ml-3">
|
2022-02-23 16:10:11 +00:00
|
|
|
<div class="text-sm font-medium"><Label label={value.label} /></div>
|
2021-11-25 11:09:37 +00:00
|
|
|
<div class="overflow-label">{value.value}</div>
|
|
|
|
</div>
|
|
|
|
<div class="button" on:click|preventDefault={copyLink}>
|
2022-04-29 05:27:17 +00:00
|
|
|
<IconCopy size={'small'} />
|
2021-11-25 11:09:37 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.button {
|
2022-02-09 09:20:30 +00:00
|
|
|
flex-shrink: 0;
|
2021-11-25 11:09:37 +00:00
|
|
|
margin-left: 1.5rem;
|
|
|
|
color: var(--theme-content-dark-color);
|
|
|
|
cursor: pointer;
|
2022-04-29 05:27:17 +00:00
|
|
|
&:hover {
|
|
|
|
color: var(--theme-caption-color);
|
|
|
|
}
|
2021-11-25 11:09:37 +00:00
|
|
|
}
|
|
|
|
</style>
|