-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathworkflow-detail.svelte
70 lines (68 loc) · 1.86 KB
/
workflow-detail.svelte
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<script lang="ts">
import Copyable from '$lib/holocene/copyable/index.svelte';
import type { IconName } from '$lib/holocene/icon';
import Icon from '$lib/holocene/icon/icon.svelte';
import Link from '$lib/holocene/link.svelte';
import Tooltip from '$lib/holocene/tooltip.svelte';
import { translate } from '$lib/i18n/translate';
export let title = '';
export let content: string;
export let copyable = false;
export let href: string = null;
export let textSize = 'md';
export let icon: IconName | undefined = undefined;
export let tooltip: string = '';
</script>
<p class="flex items-center gap-2 text-{textSize} whitespace-nowrap pt-2">
{#if copyable}
<Copyable
copyIconTitle={translate('common.copy-icon-title')}
copySuccessIconTitle={translate('common.copy-success-icon-title')}
{content}
visible
container-class="gap-1 w-full"
>
{#if icon}
<Icon name={icon} />
{/if}
{#if title}
{title}
{/if}
{#if href}
<Link
{href}
class="surface-subtle w-fit truncate rounded-sm p-1 leading-4"
>{content}</Link
>
{:else}
<Tooltip text={tooltip} hide={!tooltip} top>
<span
class="surface-subtle w-fit select-all truncate rounded-sm p-1 leading-4"
>{content}</span
>
</Tooltip>
{/if}
</Copyable>
{:else}
{#if icon}
<Icon name={icon} />
{/if}
{#if title}
{title}
{/if}
{#if href}
<Link
{href}
class="surface-subtle w-fit truncate rounded-sm p-1 leading-4"
>{content}</Link
>
{:else}
<Tooltip text={tooltip} hide={!tooltip} top>
<span
class="surface-subtle w-fit select-all truncate rounded-sm p-1 leading-4"
>{content}</span
>
</Tooltip>
{/if}
{/if}
</p>