import { Component } from '@angular/core';
import { MatIconRegistry } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';

@Component({
  selector: 'app-footer',
  templateUrl: './footer.component.html',
  styleUrl: './footer.component.css'
})
export class FooterComponent {
  year = 0;
  constructor(
    private _matIconRegistry: MatIconRegistry, 
    private _domSanitizer: DomSanitizer
  ){
    this.functAddSVGIcon();
    this.GetYear();
  }
  
  functAddSVGIcon(){
    this._matIconRegistry.addSvgIcon(
      'correo',
      this._domSanitizer.bypassSecurityTrustResourceUrl(`../../../assets/img/correo.svg`)
    );
    this._matIconRegistry.addSvgIcon(
      'linea',
      this._domSanitizer.bypassSecurityTrustResourceUrl(`../../../assets/img/linea.svg`)
    );
    this._matIconRegistry.addSvgIcon(
      'aviso',
      this._domSanitizer.bypassSecurityTrustResourceUrl(`../../../assets/img/Avisos.svg`)
    );
    this._matIconRegistry.addSvgIcon(
      'politica',
      this._domSanitizer.bypassSecurityTrustResourceUrl(`../../../assets/img/Politica.svg`)
    );
    this._matIconRegistry.addSvgIcon(
      'phone',
      this._domSanitizer.bypassSecurityTrustResourceUrl(`../../../assets/img/Phone.svg`)
    );
  }

  GetYear(){
    let today = new Date();
    this.year = today.getFullYear();
  }
}
