320320 </p >
321321 </div >
322322 </template >
323- <button
324- v-if =" nextPage"
325- type =" button"
326- class =" w-full bg-datagouv hover:bg-datagouv-dark text-white p-2 flex items-center justify-center"
327- :disabled =" isLoading"
328- @click =" loadMoreNotifications"
323+ <div
324+ v-if =" nextPage || pendingNotifications?.total"
325+ class =" px-2 py-2 space-y-2 border-t border-gray-default"
329326 >
330- <AnimatedLoader
331- v-if =" isLoading"
332- class =" size-5"
333- />
334- <RiAddLine
335- v-else
336- class =" size-5"
337- />
338- {{ t('Charger plus de notifications') }}
339- </button >
327+ <BrandedButton
328+ v-if =" nextPage"
329+ type =" button"
330+ color =" primary"
331+ size =" xs"
332+ :icon =" RiAddLine"
333+ :loading =" isLoading"
334+ class =" w-full rounded-full"
335+ @click =" loadMoreNotifications"
336+ >
337+ {{ t('Charger plus de notifications') }}
338+ </BrandedButton >
339+ <BrandedButton
340+ v-if =" pendingNotifications?.total"
341+ type =" button"
342+ color =" secondary"
343+ size =" xs"
344+ :icon =" RiCheckLine"
345+ :loading =" loading"
346+ class =" w-full rounded-full"
347+ @click =" () => markWithoutActionAsRead(notificationsCombinedList)"
348+ >
349+ {{ t('Marquer comme lues') }}
350+ </BrandedButton >
351+ </div >
340352 </template >
341353 </Toggletip >
342354 </li >
508520<script setup lang="ts">
509521import { NuxtImg as _NuxtImg } from ' #components'
510522import type { Component } from ' vue'
511- import { AnimatedLoader , BrandedButton , Toggletip , useGetUserAvatar , toast } from ' @datagouv/components-next'
512- import { RiAccountCircleLine , RiAddLine , RiDatabase2Line , RiInbox2Line , RiLockLine , RiMenuLine , RiSearchLine , RiTerminalLine , RiLineChartLine , RiServerLine , RiArticleLine , RiSettings3Line , RiLogoutBoxRLine , RiBuilding2Line , RiCloseLine } from ' @remixicon/vue'
523+ import { BrandedButton , Toggletip , useGetUserAvatar , toast } from ' @datagouv/components-next'
524+ import { RiAccountCircleLine , RiAddLine , RiCheckLine , RiDatabase2Line , RiInbox2Line , RiLockLine , RiMenuLine , RiSearchLine , RiTerminalLine , RiLineChartLine , RiServerLine , RiArticleLine , RiSettings3Line , RiLogoutBoxRLine , RiBuilding2Line , RiCloseLine } from ' @remixicon/vue'
513525import { Disclosure , DisclosureButton , DisclosurePanel , Menu , MenuButton , MenuItem , MenuItems , Popover , PopoverButton , PopoverPanel } from ' @headlessui/vue'
514526import CdataLink from ' ../CdataLink.vue'
515527import LogoAsText from ' ../LogoAsText.vue'
516528import LogoImage from ' ../LogoImage.vue'
529+ import { useMarkAsRead } from ' ~/composables/useMarkAsRead'
517530import { useNotifications } from ' ~/composables/useNotifications.client'
518531import { useLogout , useMaybeMe } from ' ~/utils/auth'
519532
@@ -534,6 +547,7 @@ const router = useRouter()
534547const route = useRoute ()
535548const { isLoading } = useLoadingIndicator ()
536549const { refreshNotifications, loadMoreNotifications, pendingNotifications, nextPage, notificationsCombinedList } = useNotifications ()
550+ const { markWithoutActionAsRead, loading } = useMarkAsRead ()
537551
538552const menu = [
539553 { label: t (' Données' ), link: ' /datasets' },
0 commit comments