flotilla/src/app/components/ProfileSpaces.svelte

53 lines
1.5 KiB
Svelte
Raw Normal View History

2025-06-05 20:01:36 +00:00
<script lang="ts">
2025-09-10 22:26:39 +00:00
import AltArrowRight from "@assets/icons/alt-arrow-right.svg?dataurl"
import AltArrowLeft from "@assets/icons/alt-arrow-left.svg?dataurl"
2025-06-05 20:01:36 +00:00
import Icon from "@lib/components/Icon.svelte"
import Link from "@lib/components/Link.svelte"
import Button from "@lib/components/Button.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import RelayIcon from "@app/components/RelayIcon.svelte"
2025-06-05 20:01:36 +00:00
import RelayName from "@app/components/RelayName.svelte"
2026-07-28 16:16:26 +00:00
import {roomLists} from "@app/core"
2026-06-08 21:14:40 +00:00
import {makeSpacePath} from "@app/routes"
2025-06-05 20:01:36 +00:00
type Props = {
pubkey: string
}
const {pubkey}: Props = $props()
2026-07-28 16:16:26 +00:00
const spaceUrls = $roomLists.urls(pubkey).$
2025-06-05 20:01:36 +00:00
const back = () => history.back()
</script>
<div class="flex flex-col gap-2">
2026-07-28 16:16:26 +00:00
{#each $spaceUrls as url (url)}
<div class="card flex flex-row items-center gap-2">
2026-04-07 21:53:19 +00:00
<div class="shrink-0">
<RelayIcon {url} size={12} />
2025-06-05 20:01:36 +00:00
</div>
2026-04-07 21:53:19 +00:00
<div class="flex grow flex-col">
2025-06-05 20:01:36 +00:00
<RelayName {url} />
<div class="text-sm opacity-75">
{url}
</div>
</div>
<Link class="button button-primary" href={makeSpacePath(url)}>
2025-06-05 20:01:36 +00:00
Go to space
2025-09-10 22:26:39 +00:00
<Icon icon={AltArrowRight} />
2025-06-05 20:01:36 +00:00
</Link>
</div>
{:else}
<div class="card text-center">
2025-06-05 20:01:36 +00:00
<p class="opacity-75">No spaces found for this user</p>
</div>
{/each}
<ModalFooter>
<Button onclick={back} class="button button-link hidden md:flex">
2025-09-10 22:26:39 +00:00
<Icon icon={AltArrowLeft} />
2025-06-05 20:01:36 +00:00
Go back
</Button>
</ModalFooter>
</div>