/* Copyright CloudLinux Zug GmbH 2010-2017 All Rights Reserved
 *
 * Licensed under CLOUD LINUX LICENSE AGREEMENT
 * http://cloudlinux.com/docs/LICENSE.TXT
 */

import { Component } from '@angular/core';
import { XHR } from './xhr';
import { Url } from './url';
import { BaseComponent } from './base_component';
import { CurrentComponent } from '../current.component';
import { TranslateService } from '@ngx-translate/core';
import { AppState } from '../app.service';

export interface PopoverStatsData {
    name: string;
    usage: string;
    limits: string;
    isChild?: boolean;
    hasChild?: boolean;
}


export interface PopoverContent {
    id: string;
    username: string;
    domain: string;
    stats: Array<PopoverStatsData>;
    restricted?: boolean;
    hidden?: boolean;
    restriction?: any;
    top?: string;
    left?: string;
}


@Component({
    selector: 'popover',
    inputs: ['content: content', 'parent: parent'],
    template: require('./../../templates/popover.html'),
    providers: [XHR],
    styles: [require('../../styles/popover.less')]
})
export class Popover extends BaseComponent{
    content: PopoverContent;
    request: XHR;
    private parent: CurrentComponent;

    constructor(
        private xhr: XHR,
        public appState: AppState
    ) {
        super();
        this.request = xhr;
    }

}
