/*
 * Copyright (C) 2023 Robert Bosch GmbH Copyright (C) 2023 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { Component, TemplateRef, ViewChild } from '@angular/core';
import { Duration, ModalWindowService } from "@bci-web-core/core";
import { MatDialog } from '@angular/material/dialog';
import { BciDurationPickerModalExampleComponent } from './modal-example/bci-duration-picker-modal-example.component';
import { ScrollIntoViewService } from '../../shared/scroll-into-view.service';

@Component({
  selector: 'bci-duration-picker-demo',
  styleUrls: ['./bci-duration-picker-demo.component.scss'],
  templateUrl: './bci-duration-picker-demo.component.html',
})

export class BciDurationPickerDemoComponent{
  standaloneComponentsDocsLink = 'https://www.youtube.com/watch?v=x5PZwb4XurU';
  durationComponentsDocsLink = 'https://atmo1opcondemo.de.bosch.com/WebCore/docs/core/components/BciDurationPickerComponent.html';
  duration: Duration = {
    hours: 166,
    minutes: 1567567,
    seconds: 1567
  };
  selectedDuration: any;
  @ViewChild('modalTemplate') template: TemplateRef<any>;
  constructor(private modalWindowService: ModalWindowService, private _matDialog: MatDialog, public scrollIntoViewService: ScrollIntoViewService) {
  }

  openModal(): void {
    this.modalWindowService.openDialogWithComponent(BciDurationPickerModalExampleComponent, {width: '600px'}, this._matDialog);
  }

  showDuration(event): void {
    this.selectedDuration = event;
  }
}

