import {Component} from '@angular/core';
import {Store} from '@ngrx/store';
import {StateInterface} from '../../reducers';
import {CommonModule} from '@angular/common';

import {AlertBox} from 'sae-lib/alert-box/alert-box';

@Component({
  selector: 'app-warning-bugs',
  standalone: true,
  imports: [
    CommonModule,
    AlertBox
  ],
  templateUrl: './warning-bugs.html',
  styleUrl: './warning-bugs.scss'
})
export class WarningBugs {
  protected displayError: boolean = false;

  constructor(private store: Store<StateInterface>) {
    // Subscribe to the app state to get the error state
    this.store.select(state => state.app.displayErrorResponse).subscribe(displayError => {
      this.displayError = displayError;
    });
  }
}
