flotilla/src/app/components/PrimaryNavItemSpace.svelte

29 lines
721 B
Svelte
Raw Normal View History

2024-11-14 18:53:13 +00:00
<script lang="ts">
import {deriveRelayDisplay} from "@welshman/app"
2024-11-14 18:53:13 +00:00
import PrimaryNavItem from "@lib/components/PrimaryNavItem.svelte"
import RelayIcon from "@app/components/RelayIcon.svelte"
2026-06-08 21:14:40 +00:00
import {makeSpacePath, goToSpace} from "@app/routes"
import {notifications} from "@app/notifications"
2024-11-14 18:53:13 +00:00
2025-11-14 23:02:23 +00:00
type Props = {
url: string
}
const {url}: Props = $props()
2024-11-14 18:53:13 +00:00
const onClick = () => goToSpace(url)
2026-05-04 23:01:39 +00:00
const path = makeSpacePath(url)
const display = $derived(deriveRelayDisplay(url))
2024-11-14 18:53:13 +00:00
</script>
<PrimaryNavItem
2026-05-04 23:01:39 +00:00
href={path}
2025-10-06 18:23:19 +00:00
onclick={onClick}
title={$display}
2024-11-14 18:53:13 +00:00
class="tooltip-right"
2026-05-04 23:01:39 +00:00
notification={$notifications.has(path)}>
<RelayIcon {url} size={10} class="rounded-full" />
2024-11-14 18:53:13 +00:00
</PrimaryNavItem>