OnlineNotification.vue 1.2 KB

1234567891011121314151617181920212223242526272829
  1. <!-- Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/ -->
  2. <script setup lang="ts">
  3. import CommonPopover from '#shared/components/CommonPopover/CommonPopover.vue'
  4. import { usePopover } from '#shared/components/CommonPopover/usePopover.ts'
  5. import { useOnlineNotificationCount } from '#shared/entities/online-notification/composables/useOnlineNotificationCount.ts'
  6. import NotificationButton from '#desktop/components/layout/LayoutSidebar/LeftSidebar/LeftSidebarHeader/OnlineNotification/NotificationButton.vue'
  7. import NotificationPopover from '#desktop/components/layout/LayoutSidebar/LeftSidebar/LeftSidebarHeader/OnlineNotification/NotificationPopover.vue'
  8. const { unseenCount } = useOnlineNotificationCount()
  9. const { popover, popoverTarget, toggle, close } = usePopover()
  10. </script>
  11. <template>
  12. <div
  13. id="app-online-notification"
  14. ref="popoverTarget"
  15. :aria-label="$t('Notifications')"
  16. class="relative"
  17. >
  18. <NotificationButton :unseen-count="unseenCount" @show="toggle(true)" />
  19. <CommonPopover ref="popover" orientation="right" :owner="popoverTarget">
  20. <NotificationPopover :unseen-count="unseenCount" @close="close" />
  21. </CommonPopover>
  22. </div>
  23. </template>