import { BreakpointObserver } from '@angular/cdk/layout';
import { Component, OnInit } from '@angular/core';
import { USERInterface } from 'src/app/interfaces/user-interface';
import { ENCService } from 'src/app/services/enc/enc.service';

@Component({
  selector: 'app-footer',
  templateUrl: './footer.component.html',
  styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
  usuario_session:USERInterface = JSON.parse(localStorage.getItem('TIMUSERENC')!);
  empresa:string = "";
  anio: number;
  footer_pantalla: string = !this.breakpointObserver.isMatched('(max-width: 1700px)') ? "footer-container-calc":"footer-container";
  pantallaGrande:Boolean =  !this.breakpointObserver.isMatched('(max-width: 1700px)');
  constructor(
    private _encService: ENCService, 
    private breakpointObserver:BreakpointObserver 
  ) { 
    this.anio = new Date().getFullYear();
    this.empresa = this._encService.desencriptar( this.usuario_session.RFCEMPRESA);
  }
  

  ngOnInit(): void {
  }

  imagenLogoITTEC(){
    if (window.location.href.includes("ferrariventilatori")) {
      return "https://ferrariventilatori.mx/vacaciones/assets/img/ITTEC-FOOTER.png"
      
    }else{
      return "../assets/img/ITTEC-FOOTER.png"
    }
  }

  onResize(event:any) {
    this.pantallaGrande = event.target.innerWidth > 1700
    if(this.pantallaGrande){
      this.footer_pantalla = "footer-container-calc";
    }else{
      this.footer_pantalla = "footer-container";
    }
  }


}
