import { Component, OnInit } from '@angular/core';
import { DomainDashboardService } from '@domain/isa';
import { of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';

@Component({
  selector: 'page-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.scss'],
})
export class DashboardComponent implements OnInit {
  feeds$ = this._domainIsaDashboardService?.feed()?.pipe(
    map((response) => response?.result ?? []),
    catchError(() => of([]))
  );

  constructor(private readonly _domainIsaDashboardService: DomainDashboardService) {}

  ngOnInit(): void {}
}
