2025-09-06 00:20:12 +00:00
|
|
|
<script lang="ts">
|
2026-07-03 23:36:52 +00:00
|
|
|
import {remove} from "@welshman/lib"
|
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"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {roomLists, user} from "@app/core"
|
2026-08-11 16:45:49 +00:00
|
|
|
import {userSpaceUrls} from "@app/rooms"
|
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()
|
2026-07-28 16:16:26 +00:00
|
|
|
const favorited = $roomLists.pubkeysForUrl(url).$
|
|
|
|
|
const favoritedPubkeys = $derived(remove($user.pubkey, $favorited))
|
2025-09-06 00:20:12 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
<div class="flex flex-col gap-4 text-left">
|
|
|
|
|
<div class="flex flex-col gap-2">
|
2026-05-06 23:39:01 +00:00
|
|
|
<div class="relative flex gap-2 sm:gap-4">
|
2025-09-06 00:20:12 +00:00
|
|
|
<div class="relative">
|
2026-06-24 20:56:53 +00:00
|
|
|
<div class="relative">
|
2025-09-06 00:20:12 +00:00
|
|
|
<div
|
2026-06-24 20:56:53 +00:00
|
|
|
class="flex justify-center items-center h-12 w-12 min-w-12 rounded-full border-2 border-solid bg-surface-more border-line">
|
2026-06-30 17:49:17 +00:00
|
|
|
<RelayIcon {url} size={10} class="rounded-full" />
|
2025-09-06 00:20:12 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-08-11 16:45:49 +00:00
|
|
|
{#if $userSpaceUrls.includes(url)}
|
2025-09-06 00:20:12 +00:00
|
|
|
<div
|
2026-06-24 20:56:53 +00:00
|
|
|
class="tip absolute -right-1 -top-1 h-5 w-5 rounded-full bg-primary text-primary-content"
|
2025-09-06 00:20:12 +00:00
|
|
|
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">
|
2026-07-02 21:22:55 +00:00
|
|
|
<RelayName {url} class="truncate whitespace-nowrap text-lg sm:text-xl" />
|
2026-05-06 23:39:01 +00:00
|
|
|
<p class="text-xs sm:text-sm opacity-75">{url}</p>
|
2025-09-06 00:20:12 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-06-30 17:49:17 +00:00
|
|
|
<div class="text-sm sm:text-md">
|
|
|
|
|
<RelayDescription {url} />
|
|
|
|
|
</div>
|
2025-09-06 00:20:12 +00:00
|
|
|
</div>
|
2026-07-04 00:14:51 +00:00
|
|
|
{#if !hideFavorites && favoritedPubkeys.length > 0}
|
2026-06-24 20:56:53 +00:00
|
|
|
<div class="flex gap-2 card card-sm">
|
2025-12-01 18:26:43 +00:00
|
|
|
Favorited By:
|
2026-07-04 00:14:51 +00:00
|
|
|
<ProfileCircles pubkeys={favoritedPubkeys} />
|
2025-09-06 00:20:12 +00:00
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|