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

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