2021-11-25 11:09:37 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
// Copyright © 2021 Hardcore Engineering Inc.
|
2023-11-20 10:01:43 +00:00
|
|
|
//
|
2021-11-25 11:09:37 +00:00
|
|
|
// 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
|
2023-11-20 10:01:43 +00:00
|
|
|
//
|
2021-11-25 11:09:37 +00:00
|
|
|
// 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.
|
2023-11-20 10:01:43 +00:00
|
|
|
//
|
2021-11-25 11:09:37 +00:00
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
2023-03-15 14:06:03 +00:00
|
|
|
import type { Asset, IntlString } from '@hcengineering/platform'
|
2022-10-06 09:38:47 +00:00
|
|
|
import { copyTextToClipboard } from '@hcengineering/presentation'
|
2022-09-21 08:08:25 +00:00
|
|
|
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-10-06 09:38:47 +00:00
|
|
|
copyTextToClipboard(value.value)
|
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>
|
2023-03-10 00:08:04 +00:00
|
|
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
2023-11-27 06:54:39 +00:00
|
|
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
2021-11-25 11:09:37 +00:00
|
|
|
<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;
|
2023-03-10 00:08:04 +00:00
|
|
|
color: var(--dark-color);
|
2021-11-25 11:09:37 +00:00
|
|
|
cursor: pointer;
|
2022-04-29 05:27:17 +00:00
|
|
|
&:hover {
|
2023-03-10 00:08:04 +00:00
|
|
|
color: var(--caption-color);
|
2022-04-29 05:27:17 +00:00
|
|
|
}
|
2021-11-25 11:09:37 +00:00
|
|
|
}
|
|
|
|
</style>
|