import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'
import { ActivatedRoute, Router, ParamMap } from '@angular/router'
import { ConfigService } from '../../_services/config.service'

@Component({
    selector: 'gisaf-measures-home',
    template: '<p>Select a data store</p>',
})
export class MeasuresHomeComponent implements OnInit {
    constructor(
        public configService: ConfigService,
        private router: Router
    ) {}
    ngOnInit() {
        this.configService.conf.subscribe(
            conf => {
                if (conf.bsData?.measures) {
                    this.router.navigate(['/measures', conf.bsData.measures['defaultStore']])
                }
            }
        )
    }
}