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

import LiferayParams from '../types/LiferayParams'

declare const Liferay: any;

@Component({
	templateUrl: 
		Liferay.ThemeDisplay.getPathContext() + 
		'/o/<%= pkgJson.name %>/app/app.component.html'
})
export class AppComponent {
	params: LiferayParams;
	labels: any;

	constructor() {
		this.labels = {        
			<% if (hasConfiguration) { %>
			configuration: <%- labels.configuration %>,
			<% } %>
			portletNamespace: <%- labels.portletNamespace %>,
        	contextPath: <%- labels.contextPath %>,
			portletElementId: <%- labels.portletElementId %>,
		}
	}

	get configurationJSON() {
		return JSON.stringify(this.params.configuration, null, 2);
	}
}
