flotilla/src/app/components/MenuSpacesItem.svelte

33 lines
992 B
Svelte
Raw Normal View History

2024-11-14 20:16:44 +00:00
<script lang="ts">
import Link from "@lib/components/Link.svelte"
import CardButton from "@lib/components/CardButton.svelte"
import RelayIcon from "@app/components/RelayIcon.svelte"
2024-11-14 20:16:44 +00:00
import RelayName from "@app/components/RelayName.svelte"
import RelayDescription from "@app/components/RelayDescription.svelte"
import {makeSpacePath} from "@app/util/routes"
import {notifications} from "@app/util/notifications"
2024-11-14 20:16:44 +00:00
const {url} = $props()
2024-11-14 20:16:44 +00:00
const path = makeSpacePath(url)
</script>
<Link replaceState href={path}>
2025-11-05 23:24:46 +00:00
<CardButton class="btn-neutral shadow-md">
2025-02-04 00:37:14 +00:00
{#snippet icon()}
<RelayIcon {url} size={12} />
2025-02-04 00:37:14 +00:00
{/snippet}
{#snippet title()}
<div class="flex gap-1">
<RelayName {url} />
{#if $notifications.has(path)}
<div class="relative top-1 h-2 w-2 rounded-full bg-primary"></div>
{/if}
</div>
{/snippet}
{#snippet info()}
<div><RelayDescription {url} /></div>
{/snippet}
2024-11-14 20:16:44 +00:00
</CardButton>
</Link>