|
4 | 4 | import { page } from '$app/stores';
|
5 | 5 |
|
6 | 6 | import Badge from '$lib/holocene/badge.svelte';
|
| 7 | + import Copyable from '$lib/holocene/copyable/index.svelte'; |
7 | 8 | import Icon from '$lib/holocene/icon/icon.svelte';
|
8 | 9 | import Link from '$lib/holocene/link.svelte';
|
9 | 10 | import Tooltip from '$lib/holocene/tooltip.svelte';
|
|
114 | 115 | secondaryAttribute?.key &&
|
115 | 116 | secondaryAttribute?.key !== primaryAttribute?.key &&
|
116 | 117 | !currentEvent?.userMetadata?.summary;
|
| 118 | + $: eventTime = formatDate(currentEvent?.eventTime, $timeFormat, { |
| 119 | + relative: $relativeTime, |
| 120 | + }); |
| 121 | + $: abbrEventTime = formatDate(currentEvent?.eventTime, $timeFormat, { |
| 122 | + relative: $relativeTime, |
| 123 | + abbrFormat: true, |
| 124 | + }); |
117 | 125 | </script>
|
118 | 126 |
|
119 | 127 | <tr
|
|
160 | 168 | text={isEventGroup(event) ? `Duration: ${duration}` : `+${elapsedTime}`}
|
161 | 169 | bottom
|
162 | 170 | >
|
163 |
| - {formatDate(currentEvent?.eventTime, $timeFormat, { |
164 |
| - relative: $relativeTime, |
165 |
| - abbrFormat: true, |
166 |
| - })} |
| 171 | + <Copyable |
| 172 | + copyIconTitle={translate('common.copy-icon-title')} |
| 173 | + copySuccessIconTitle={translate('common.copy-success-icon-title')} |
| 174 | + content={abbrEventTime} |
| 175 | + > |
| 176 | + {abbrEventTime} |
| 177 | + </Copyable> |
167 | 178 | </Tooltip>
|
168 | 179 | </td>
|
169 | 180 | <td class="hidden text-right md:block">
|
|
172 | 183 | text={isEventGroup(event) ? `Duration: ${duration}` : `+${elapsedTime}`}
|
173 | 184 | bottom
|
174 | 185 | >
|
175 |
| - {formatDate(currentEvent?.eventTime, $timeFormat, { |
176 |
| - relative: $relativeTime, |
177 |
| - })} |
| 186 | + <Copyable |
| 187 | + copyIconTitle={translate('common.copy-icon-title')} |
| 188 | + copySuccessIconTitle={translate('common.copy-success-icon-title')} |
| 189 | + content={eventTime} |
| 190 | + > |
| 191 | + {eventTime} |
| 192 | + </Copyable> |
178 | 193 | </Tooltip>
|
179 | 194 | </td>
|
180 | 195 | <td class="truncate md:min-w-fit">
|
|
0 commit comments