2024-08-19 21:22:16 +00:00
|
|
|
<script lang="ts">
|
2024-08-26 21:43:43 +00:00
|
|
|
import cx from "classnames"
|
|
|
|
|
import type {NodeViewProps} from "@tiptap/core"
|
|
|
|
|
import {NodeViewWrapper} from "svelte-tiptap"
|
|
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import Button from "@lib/components/Button.svelte"
|
|
|
|
|
import {clip} from "@app/toast"
|
2024-08-19 21:22:16 +00:00
|
|
|
|
2024-08-26 21:43:43 +00:00
|
|
|
export let node: NodeViewProps["node"]
|
|
|
|
|
export let selected: NodeViewProps["selected"]
|
2024-08-23 20:33:36 +00:00
|
|
|
|
|
|
|
|
const copy = () => clip(node.attrs.lnbc)
|
2024-08-19 21:22:16 +00:00
|
|
|
</script>
|
|
|
|
|
|
2024-08-23 20:33:36 +00:00
|
|
|
<NodeViewWrapper class="inline">
|
2024-08-26 21:43:43 +00:00
|
|
|
<Button on:click={copy} class={cx("link-content", {"link-content-selected": selected})}>
|
2024-08-23 20:33:36 +00:00
|
|
|
<Icon icon="bolt" size={3} class="inline-block translate-y-px" />
|
|
|
|
|
{node.attrs.lnbc.slice(0, 16)}...
|
|
|
|
|
</Button>
|
2024-08-19 21:22:16 +00:00
|
|
|
</NodeViewWrapper>
|