import {Component} from '@angular/core';
import {NgbOffcanvas} from '@ng-bootstrap/ng-bootstrap';

import {MenuComponent} from './menu/menu.component';
import {SdmDihService} from './sdm-dih.service';

@Component({
  selector: 'application-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
})
export class AppComponent {
  offcanvasRef;

  constructor(
    private offcanvasService: NgbOffcanvas,
    public sdmDihService: SdmDihService
  ) {}

  toggleMenu() {
    if (this.offcanvasService.hasOpenOffcanvas()) {
      return;
    }
    this.offcanvasService.open(MenuComponent, {
      scroll: true,
      backdrop: true,
    });
  }
}
