/* eslint-disable camelcase */ import { Component, Prop, Vue, Watch } from 'vue-property-decorator'; import moment from 'moment-jalaali'; import { now, yesterday, beforeDays } from '@/utils/momentCustom'; import { Announcement, Notification } from '@/types'; import Tabs from '@/components/Tabs/index.vue'; import EmptyState from '@/components/EmptyState/index.vue'; import Tab from '@/components/Tabs/Tab/index.vue'; import Icon from '@/components/Icon/index.vue'; import Button from '@/components/Button/index.vue'; import Link from '@/components/Link/index.vue'; import Tooltip from '@/components/Tooltip/index.vue'; @Component({ components: { Tabs, Tab, Icon, Button, Link, EmptyState, Tooltip, }, }) export default class NotificationCenter extends Vue { @Prop({ type: Array, default: () => [] }) readonly announcements!: Announcement[]; @Prop({ type: Array, default: () => [] }) readonly notifications?: Notification[]; @Prop({ type: Array, default: () => [] }) readonly archives!: Announcement[]; @Prop({ type: Boolean }) readonly indicator?: boolean; showArchives = false; isShow = false; tabIndex = 0; toggle(): void { this.isShow = !this.isShow; } moveToArchive(id: string) { this.$emit('click:archive', id) } tabClicked(tabIndex) { this.tabIndex = tabIndex if (this.isShow) { this.$emit('click:tab', this.tabIndex) } } @Watch('isShow') isShowOnChange(newVal: boolean) { if (newVal) { this.$emit('click:tab', this.tabIndex) } } }