2025-09-06 00:20:12 +00:00
|
|
|
<script lang="ts">
|
2025-09-10 22:26:39 +00:00
|
|
|
import CheckCircle from "@assets/icons/check-circle.svg?dataurl"
|
2025-09-06 00:20:12 +00:00
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import RelayName from "@app/components/RelayName.svelte"
|
2025-11-12 01:48:24 +00:00
|
|
|
import RelayIcon from "@app/components/RelayIcon.svelte"
|
2025-09-06 00:20:12 +00:00
|
|
|
import RelayDescription from "@app/components/RelayDescription.svelte"
|
|
|
|
|
import ProfileCircles from "@app/components/ProfileCircles.svelte"
|
2025-12-01 18:26:43 +00:00
|
|
|
import {deriveGroupListPubkeys, deriveUserRooms} from "@app/core/state"
|
2025-09-06 00:20:12 +00:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
url: string
|
2026-03-31 20:34:47 +00:00
|
|
|
hideFavorites?: boolean
|
2025-09-06 00:20:12 +00:00
|
|
|
}
|
|
|
|
|
|
2026-03-31 20:34:47 +00:00
|
|
|
const {url, hideFavorites}: Props = $props()
|
2025-10-15 16:04:17 +00:00
|
|
|
const rooms = deriveUserRooms(url)
|
2025-12-01 18:26:43 +00:00
|
|
|
const favorited = deriveGroupListPubkeys(url)
|
2025-09-06 00:20:12 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div class="col-4 text-left">
|
|
|
|
|
<div class="col-2">
|
|
|
|
|
<div class="relative flex gap-4">
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<div class="avatar relative">
|
|
|
|
|
<div
|
|
|
|
|
class="center !flex h-12 w-12 min-w-12 rounded-full border-2 border-solid border-base-300 bg-base-300">
|
2025-11-12 01:48:24 +00:00
|
|
|
<RelayIcon {url} />
|
2025-09-06 00:20:12 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-10-15 16:04:17 +00:00
|
|
|
{#if $rooms.includes(url)}
|
2025-09-06 00:20:12 +00:00
|
|
|
<div
|
|
|
|
|
class="tooltip absolute -right-1 -top-1 h-5 w-5 rounded-full bg-primary"
|
|
|
|
|
data-tip="You are already a member of this space.">
|
2025-09-10 22:26:39 +00:00
|
|
|
<Icon icon={CheckCircle} class="scale-110" />
|
2025-09-06 00:20:12 +00:00
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2026-04-02 23:47:32 +00:00
|
|
|
<div class="min-w-0">
|
2025-09-06 00:20:12 +00:00
|
|
|
<h2 class="ellipsize whitespace-nowrap text-xl">
|
|
|
|
|
<RelayName {url} />
|
|
|
|
|
</h2>
|
|
|
|
|
<p class="text-sm opacity-75">{url}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<RelayDescription {url} />
|
|
|
|
|
</div>
|
2026-03-31 20:34:47 +00:00
|
|
|
{#if !hideFavorites && $favorited.size > 0}
|
2025-09-06 00:20:12 +00:00
|
|
|
<div class="row-2 card2 card2-sm bg-alt">
|
2025-12-01 18:26:43 +00:00
|
|
|
Favorited By:
|
|
|
|
|
<ProfileCircles pubkeys={Array.from($favorited)} />
|
2025-09-06 00:20:12 +00:00
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|