2025-10-06 18:23:19 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import cx from "classnames"
|
|
|
|
|
import type {ComponentProps} from "svelte"
|
2026-08-14 15:47:36 +00:00
|
|
|
import {MESSAGE, getIdOrAddress} from "@welshman/util"
|
2025-10-06 18:23:19 +00:00
|
|
|
import {isMobile} from "@lib/html"
|
|
|
|
|
import Link from "@lib/components/Link.svelte"
|
|
|
|
|
import NoteContent from "@app/components/NoteContent.svelte"
|
2026-08-14 15:47:36 +00:00
|
|
|
import {makeContentPath} from "@app/routes"
|
2025-10-06 18:23:19 +00:00
|
|
|
|
|
|
|
|
const props: ComponentProps<typeof NoteContent> = $props()
|
2026-08-14 15:47:36 +00:00
|
|
|
const path = makeContentPath(props.url!, props.event.kind, getIdOrAddress(props.event))
|
2026-07-08 17:29:56 +00:00
|
|
|
|
2026-04-10 17:11:48 +00:00
|
|
|
const minLength = 5000
|
|
|
|
|
const maxLength = 5500
|
2026-07-08 17:29:56 +00:00
|
|
|
const className = cx("text-sm block", {"card card-sm shadow-none": props.event.kind !== MESSAGE})
|
2025-10-06 18:23:19 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-07-08 17:29:56 +00:00
|
|
|
{#if path && !isMobile}
|
|
|
|
|
<Link href={path} class={className}>
|
|
|
|
|
<NoteContent {...props} {minLength} {maxLength} />
|
|
|
|
|
</Link>
|
|
|
|
|
{:else}
|
|
|
|
|
<div class={className}>
|
2026-04-10 16:37:23 +00:00
|
|
|
<NoteContent {...props} {minLength} {maxLength} />
|
2026-07-08 17:29:56 +00:00
|
|
|
</div>
|
|
|
|
|
{/if}
|