feat: add room mentions and clickable room/relay refs

This commit is contained in:
2026-04-04 16:48:29 +05:30
parent 65ca8a7fd8
commit 12fd552e1b
10 changed files with 327 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
<script lang="ts">
import {displayRelayUrl} from "@welshman/util"
import {deriveRoom, splitRoomId} from "@app/core/state"
type Props = {
value: string
}
const {value}: Props = $props()
const [url = "", h = ""] = splitRoomId(value)
const room = deriveRoom(url, h)
</script>
<div class="flex max-w-full flex-col gap-1">
<div class="overflow-hidden text-ellipsis text-base font-semibold">~{$room.name || h}</div>
<div class="overflow-hidden text-ellipsis text-sm opacity-75">{displayRelayUrl(url)}'{h}</div>
</div>