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

@Component({
  selector: 'openaire-publication',
  template: `
    <result-landing type="publication" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>
  `,
})
export class OpenairePublicationComponent {
  piwikSiteId = null;
  communityId = null;

  constructor() {}
  
  ngOnInit() {
    this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
    this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
  }
}
