import {Component, OnInit} from '@angular/core';

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

@Component({
  selector: 'openaire-search-organizations',
  template: `
    <search-organizations></search-organizations>
  `
})
export class OpenaireSearchOrganizationsComponent implements OnInit {
  piwikSiteId = null;
  
  constructor() {
  }
  
  ngOnInit() {
    let communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
    if (communityId) {
      this.piwikSiteId = PiwikHelper.getSiteId(communityId, properties.environment);
    }
  }
}
