import { Injectable } from '@angular/core'; import { WptSnackBar, WptSnackBarRef } from '@arrow/warpaint/snack-bar'; import { Observable } from 'rxjs'; export type NotificationStyle = 'info' | 'primary' | 'warn'; @Injectable() export class BomNotificationService { constructor(private _snackBar: WptSnackBar) {} notify( message: string, action: string = '', style: NotificationStyle = 'info', actionBtn: string = '', ): Observable | null { if (action === 'info' || action === 'primary' || action === 'warn') { style = action; action = ''; } const ref: WptSnackBarRef = this._snackBar.open(message, actionBtn, { panelClass: "blue" }); return action ? ref.onAction() : null; } }