flotilla/src/app/components/MenuSpaceButton.svelte

22 lines
690 B
Svelte
Raw Normal View History

2024-11-15 22:03:54 +00:00
<script lang="ts">
import Icon from "@lib/components/Icon.svelte"
import Button from "@lib/components/Button.svelte"
import MenuSpace from "@app/components/MenuSpace.svelte"
2024-12-16 19:24:10 +00:00
import {notifications} from "@app/notifications"
import {makeSpacePath} from "@app/routes"
2024-11-15 22:03:54 +00:00
import {pushDrawer} from "@app/modal"
const {url} = $props()
2024-11-15 22:03:54 +00:00
2024-12-16 19:24:10 +00:00
const path = makeSpacePath(url)
2024-11-15 22:03:54 +00:00
2024-12-16 19:24:10 +00:00
const openMenu = () => pushDrawer(MenuSpace, {url})
2024-11-15 22:03:54 +00:00
</script>
<Button onclick={openMenu} class="btn btn-neutral btn-sm relative md:hidden">
2024-11-15 22:03:54 +00:00
<Icon icon="menu-dots" />
2024-12-16 19:24:10 +00:00
{#if $notifications.has(path)}
2025-02-03 23:01:42 +00:00
<div class="absolute right-0 top-0 -mr-1 -mt-1 h-2 w-2 rounded-full bg-primary"></div>
2024-11-15 22:03:54 +00:00
{/if}
</Button>