import {Component, OnInit} from '@angular/core';
import {ConnectHelper} from "../../openaireLibrary/connect/connectHelper";
import {PiwikHelper} from "../../utils/piwikHelper";
import {properties} from "../../../environments/environment";

@Component({
  selector: 'openaire-publication',
  template: `
    <result-landing type="result" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>`,
})
export class OpenaireResultComponent implements OnInit{
  piwikSiteId;
  communityId;
  
  constructor() {}
  
  ngOnInit() {
    this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
    this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, properties.environment);
  }
}
