flotilla/src/app/components/SpaceMenuRoomItem.svelte

30 lines
1 KiB
Svelte
Raw Normal View History

2024-11-14 18:53:13 +00:00
<script lang="ts">
2026-01-22 20:37:30 +00:00
import VolumeCross from "@assets/icons/volume-cross.svg?dataurl"
2026-01-30 16:41:58 +00:00
import VolumeLoud from "@assets/icons/volume-loud.svg?dataurl"
2026-01-22 20:37:30 +00:00
import Icon from "@lib/components/Icon.svelte"
2024-11-14 18:53:13 +00:00
import SecondaryNavItem from "@lib/components/SecondaryNavItem.svelte"
2025-10-30 22:36:14 +00:00
import RoomNameWithImage from "@app/components/RoomNameWithImage.svelte"
import {makeRoomPath} from "@app/util/routes"
2026-02-02 22:29:12 +00:00
import {deriveShouldNotify} from "@app/core/state"
2024-11-14 18:53:13 +00:00
2025-02-04 00:37:14 +00:00
interface Props {
url: any
2025-10-30 22:33:34 +00:00
h: any
replaceState?: boolean
2025-02-04 00:37:14 +00:00
}
const {url, h, replaceState = false}: Props = $props()
2024-11-14 18:53:13 +00:00
2025-10-30 22:33:34 +00:00
const path = makeRoomPath(url, h)
2026-02-02 22:29:12 +00:00
const shouldNotifyForSpace = deriveShouldNotify(url)
const shouldNotifyForRoom = deriveShouldNotify(url, h)
const showDifferenceIcon = $derived($shouldNotifyForRoom !== $shouldNotifyForSpace)
2024-11-14 18:53:13 +00:00
</script>
<SecondaryNavItem href={path} {replaceState}>
2025-10-30 22:36:14 +00:00
<RoomNameWithImage {url} {h} />
2026-01-30 16:41:58 +00:00
{#if showDifferenceIcon}
2026-02-02 22:29:12 +00:00
<Icon icon={$shouldNotifyForRoom ? VolumeLoud : VolumeCross} size={4} class="opacity-50" />
2026-01-22 20:37:30 +00:00
{/if}
2024-11-14 18:53:13 +00:00
</SecondaryNavItem>