<template>
  <transition
    appear
    enter-active-class="animated fadeIn"
    leave-active-class="animated fadeOut"
  >
    <div class="ui-notification__clear-all q-mt-md">
      <ui-btn
        @click="clearNotifications"
        rounded
        label="Отметить все как прочитанные"
        size="sm"
      />
    </div>
  </transition>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import UiBtn from '../../buttons/UiBtn.vue'
import NotificationsStore, {
  getNotificationsStore,
} from './stores/NotificationsStore'

@Component({
  components: { UiBtn },
  inheritAttrs: false,
})
export default class UiNotificationClearAllBtn extends Vue {
  notificationStore!: NotificationsStore

  created() {
    this.notificationStore = getNotificationsStore(this.$store)
  }

  clearNotifications() {
    return this.notificationStore.closeAllNotifications()
  }
}
</script>
