flotilla/src/app/components/RoomItemContent.svelte

27 lines
842 B
Svelte
Raw Normal View History

2025-10-06 18:23:19 +00:00
<script lang="ts">
import cx from "classnames"
import type {ComponentProps} from "svelte"
import {MESSAGE} from "@welshman/util"
import {isMobile} from "@lib/html"
import Link from "@lib/components/Link.svelte"
import NoteContent from "@app/components/NoteContent.svelte"
2026-06-08 21:14:40 +00:00
import {getRoomItemPath} from "@app/routes"
2025-10-06 18:23:19 +00:00
const props: ComponentProps<typeof NoteContent> = $props()
2025-10-30 22:36:14 +00:00
const path = getRoomItemPath(props.url!, props.event)
const minLength = 5000
const maxLength = 5500
const className = cx("text-sm block", {"card card-sm shadow-none": props.event.kind !== MESSAGE})
2025-10-06 18:23:19 +00:00
</script>
{#if path && !isMobile}
<Link href={path} class={className}>
<NoteContent {...props} {minLength} {maxLength} />
</Link>
{:else}
<div class={className}>
<NoteContent {...props} {minLength} {maxLength} />
</div>
{/if}