import { Injectable } from '@angular/core';
import { BehaviorSubject } from 'rxjs';

@Injectable({
  providedIn: 'root',
})
export class NavigationPanelService {
  constructor() {}

  public isNavigationOpen: boolean = false;

  private _showNavigationPanelSubject = new BehaviorSubject<any>(false);
  public showNavigationPanel$ = this._showNavigationPanelSubject.asObservable();

  public openNavigation(): void {
    this.isNavigationOpen = true;
    this._showNavigationPanelSubject.next(true);
  }

  public closeNavigation(): void {
    this.isNavigationOpen = false;
    this._showNavigationPanelSubject.next(false);
  }
}
