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

@Component({
  selector: 'community-fos',
  template: `
    <fos [piwikSiteId]="piwikSiteId"></fos>
  `
})

export class CommunityFosComponent {
  piwikSiteId;
  communityId;

  constructor() {
  }

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