184-message-truncation #186
@@ -8,16 +8,22 @@
|
||||
import {getRoomItemPath} from "@app/util/routes"
|
||||
|
||||
const props: ComponentProps<typeof NoteContent> = $props()
|
||||
const MESSAGE_MIN_LENGTH = 5000
|
||||
const MESSAGE_MAX_LENGTH = 5500
|
||||
|
||||
const path = getRoomItemPath(props.url!, props.event)
|
||||
const minLength =
|
||||
props.minLength ?? (props.event.kind === MESSAGE ? MESSAGE_MIN_LENGTH : undefined)
|
||||
const maxLength =
|
||||
props.maxLength ?? (props.event.kind === MESSAGE ? MESSAGE_MAX_LENGTH : undefined)
|
||||
</script>
|
||||
|
||||
<div class={cx("text-sm", {"card2 card2-sm bg-alt": props.event.kind !== MESSAGE})}>
|
||||
{#if path && !isMobile}
|
||||
<Link href={path}>
|
||||
<NoteContent {...props} />
|
||||
<NoteContent {...props} {minLength} {maxLength} />
|
||||
</Link>
|
||||
{:else}
|
||||
<NoteContent {...props} />
|
||||
<NoteContent {...props} {minLength} {maxLength} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user