import { Component, input } from '@angular/core';
import { RouterModule } from '@angular/router';

import SharedModule from 'app/shared/shared.module';
import { DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe } from 'app/shared/date';
import { IDashboardComponent, NewDashboardComponent } from '../dashboard-component.model';
import { AbstractResilientEntityComponent } from 'app/entities/resilient/resilient-entity.component';
import { DashboardComponentService } from '../service/dashboard-component.service';

@Component({
  standalone: true,
  selector: 'jhi-dashboard-component-detail',
  templateUrl: './dashboard-component-detail.component.html',
  imports: [SharedModule, RouterModule, DurationPipe, FormatMediumDatetimePipe, FormatMediumDatePipe],
})
export class DashboardComponentDetailComponent extends AbstractResilientEntityComponent<IDashboardComponent, NewDashboardComponent, DashboardComponentService> {
  dashboardComponent = input<IDashboardComponent | null>(null);
  currentTab: string = 'details'; // default tab

  constructor(service: DashboardComponentService) { super(service); }
  
  setTab(tabId: string): void {
    this.currentTab = tabId;
  }
  
  previousState(): void {
    window.history.back();
  }
}
