import { Component, Injector, OnInit, ViewChild, ViewEncapsulation, Input } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { AppConsts } from '@shared/AppConsts';
import { appModuleAnimation } from '@shared/animations/routerTransition';
import { AppComponentBase } from '@shared/common/app-component-base';
import { RouteListDto, RouteServiceProxy } from '@shared/service-proxies/service-proxies';

import * as moment from 'moment';
import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent';
import { Paginator } from 'primeng/components/paginator/paginator';
import { Table } from 'primeng/components/table/table';
import { HttpClient } from '@angular/common/http';
import { finalize } from 'rxjs/operators';

@Component({
	selector: 'devices',
    templateUrl: './devices.component.html',
    encapsulation: ViewEncapsulation.None,
    styleUrls: ['./devices.component.less'],
    animations: [appModuleAnimation()]
})

export class DevicesComponent extends AppComponentBase implements OnInit {
    hide : boolean;

    @Input('version') version: string;
    @Input('device_type') device_type: string;
    @Input('current_version') current_version: string;
    behind_count: number;

	constructor(
        injector: Injector,
        private _routeService: RouteServiceProxy
        
    ) {
        super(injector);
    }

    ngOnInit(): void {
       this.behind_count = parseInt(this.current_version) - parseInt(this.version);
    }

    
}