// Angular Core
import { Component, Input, OnInit, TemplateRef } from '@angular/core';

// Thired Party
import { NgbModal, NgbModalConfig } from '@ng-bootstrap/ng-bootstrap';

@Component({
  standalone: false,
  selector: 'app-base-modal',
  templateUrl: './base-modal.component.html',
  styleUrls: ['./base-modal.component.scss'],
  // add NgbModalConfig and NgbModal to the component providers
	providers: [NgbModalConfig, NgbModal],
})
export class BaseModalComponent implements OnInit {

  @Input() config:any;
  constructor(config: NgbModalConfig, private modalService: NgbModal) {
    // customize default values of modals used by this component tree
		config.backdrop = 'static';
		config.keyboard = false;
  }

  open(content:TemplateRef<any>) {
		this.modalService.open(content);
	}

    close () {
        this.modalService.dismissAll();
    }

  ngOnInit(): void {

  }
}
