mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 02:00:31 +08:00
We don't really need the `clipboard` prop. By switching between stats in patches and issue listings the clipboard props aren't been recomputed. Wrote a test that should make sure this doesn't break in the future.
24 lines
616 B
Svelte
24 lines
616 B
Svelte
<script lang="ts">
|
|
import type { Node } from "@http-client";
|
|
|
|
import { truncateId } from "@app/lib/utils";
|
|
import Id from "@app/components/Id.svelte";
|
|
|
|
export let node: Node;
|
|
|
|
$: clipboard = node.config?.externalAddresses
|
|
? `${node.id}@${node.config.externalAddresses[0]}`
|
|
: node.id;
|
|
</script>
|
|
|
|
<div style:word-break="break-word">
|
|
<!--prettier-ignore-->
|
|
<Id ariaLabel="node-id" shorten={false} id={clipboard}>
|
|
{#if node.config?.externalAddresses.length}
|
|
{truncateId(node.id)}@<wbr />{node.config?.externalAddresses[0]}
|
|
{:else}
|
|
{truncateId(node.id)}
|
|
{/if}
|
|
</Id>
|
|
</div>
|