import { Site } from 'src/app/core/interfaces/site/site';
import { QueryService } from './../../../../../core/services/query/query.service';
import { Component, Input, OnInit } from '@angular/core';
import { environment } from 'src/environments/environment';

@Component({
  selector: 'app-modal-site',
  templateUrl: './modal-site.component.html',
  styleUrls: ['./modal-site.component.scss']
})
export class ModalSiteComponent implements OnInit {

  url = environment.BASE_URL_API;
  loading = true;
  @Input() isOpenModal: boolean = false;
  @Input() allyId!: number;
  display = 'none';
  ally!: Site;

  constructor() { }

  ngOnInit(): void {
  }

  switchModal(){
    const modal = document.getElementById('staticBackdrop');
    if(this.isOpenModal == false){
      modal?.classList.add("show")
      this.display = 'block';
      this.isOpenModal = true
    }else{
      this.display = 'none';
      modal?.classList.remove("show")
      this.isOpenModal = false;
    }
  }

}
