import { Component, OnInit } from '@angular/core';
import { AppComponent } from '../../../../app.component';
import { PagesComponent } from '../../../../pages/pages.component';
import { Notification } from '@overflow/commons-typescript/model/notification';

@Component({
    selector: 'of-topbar',
    templateUrl: './app.topbar.component.html',
})
export class AppTopbarComponent implements OnInit {

    notificationCount;
    constructor(
        public app: PagesComponent,
    ) { }

    ngOnInit() {
    }

    onNotiLoaded(count) {
        this.notificationCount = count;
    }

    onViewAllNotification() {
        this.app.redirectNotifications();
    }

    onNotificationSelect(notification: Notification) {
        this.app.redirect(notification.url);
    }
}
