2026-02-16 17:03:00 +00:00
|
|
|
<script lang="ts">
|
2026-09-07 20:53:25 +00:00
|
|
|
import {MESSAGE, displayRelayUrl, tagSpec, tagValue} from "@welshman/util"
|
2026-06-24 20:56:53 +00:00
|
|
|
import Badge from "@lib/components/Badge.svelte"
|
2026-06-24 20:10:06 +00:00
|
|
|
import Modal from "@lib/components/Modal.svelte"
|
|
|
|
|
import ModalHeader from "@lib/components/ModalHeader.svelte"
|
|
|
|
|
import ModalTitle from "@lib/components/ModalTitle.svelte"
|
|
|
|
|
import ModalSubtitle from "@lib/components/ModalSubtitle.svelte"
|
|
|
|
|
import RoomName from "@app/components/RoomName.svelte"
|
2026-09-07 20:53:25 +00:00
|
|
|
import SearchBody from "@app/components/SearchBody.svelte"
|
2026-06-08 22:33:38 +00:00
|
|
|
import {CONTENT_KINDS} from "@app/content"
|
2026-09-07 20:53:25 +00:00
|
|
|
import {relayMemberLists} from "@app/core"
|
2026-02-16 17:03:00 +00:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
url: string
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-24 20:10:06 +00:00
|
|
|
const {url}: Props = $props()
|
2026-02-16 17:03:00 +00:00
|
|
|
|
2026-09-07 20:53:25 +00:00
|
|
|
const filter = {kinds: [MESSAGE, ...CONTENT_KINDS]}
|
2026-04-02 18:49:18 +00:00
|
|
|
|
2026-09-07 20:53:25 +00:00
|
|
|
const members = $relayMemberLists.forUrl(url)
|
2026-02-16 17:03:00 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
<Modal class="flex flex-col gap-2">
|
2026-06-24 20:10:06 +00:00
|
|
|
<ModalHeader>
|
2026-09-07 20:53:25 +00:00
|
|
|
<ModalTitle>Search</ModalTitle>
|
2026-06-24 20:10:06 +00:00
|
|
|
<ModalSubtitle>
|
|
|
|
|
on <span class="text-primary">{displayRelayUrl(url)}</span>
|
|
|
|
|
</ModalSubtitle>
|
|
|
|
|
</ModalHeader>
|
2026-09-07 20:53:25 +00:00
|
|
|
<SearchBody
|
|
|
|
|
{url}
|
|
|
|
|
{filter}
|
|
|
|
|
placeholder="Search this space..."
|
|
|
|
|
relays={[url]}
|
|
|
|
|
members={$members?.pubkeys() ?? []}>
|
|
|
|
|
{#snippet badges(event)}
|
|
|
|
|
{@const h = tagValue(tagSpec("h"), event.tags)}
|
|
|
|
|
{#if h}
|
|
|
|
|
<Badge variant="neutral">
|
|
|
|
|
<RoomName {url} {h} />
|
|
|
|
|
</Badge>
|
|
|
|
|
{/if}
|
|
|
|
|
{/snippet}
|
|
|
|
|
</SearchBody>
|
2026-06-24 20:10:06 +00:00
|
|
|
</Modal>
|