Files
descrybe/apps/web/src/lib/components/SupportNotificationBell.svelte
T
greeneclipse 8580c996c3 Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
2026-08-09 22:47:43 +02:00

32 lines
1.2 KiB
Svelte

<script lang="ts">
import { Bell } from "@lucide/svelte";
import { i18n } from "$lib/i18n";
import { supportNotifications } from "$lib/support/notifications.svelte";
const unread = $derived(supportNotifications.unreadCount);
const show = $derived(supportNotifications.available && unread > 0);
const label = $derived(
show
? i18n.t("support.notifications.ariaUnread", { count: unread })
: i18n.t("support.notifications.aria")
);
</script>
<a
href="/support"
class="relative inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-md text-muted-foreground transition hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:h-8 sm:w-8 {!show ? 'max-sm:hidden' : ''}"
data-tour="support-notification-bell"
aria-label={label}
title={label}
>
<Bell class="h-4 w-4" aria-hidden="true" />
{#if show}
<span
class="pointer-events-none absolute right-0.5 top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[10px] font-semibold leading-none text-primary-foreground ring-2 ring-background"
aria-hidden="true"
>
{unread > 99 ? "99+" : unread}
</span>
{/if}
</a>