import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { IHeatStackPreviewModel } from '@fleio-api/openstack/orchestration/model/heat-stack-preview.model';
import { IBaseDialog } from '@shared/common-dialogs/base-dialog';
import { IAction } from '@objects-view/interfaces/actions/action';
import { DialogCallbackAction } from '@objects-view/actions/dialog-callback-action';

@Component({
  selector: 'app-heat-stack-preview-dialog',
  templateUrl: './heat-stack-preview-dialog.component.html',
  styleUrls: ['./heat-stack-preview-dialog.component.scss']
})
export class HeatStackPreviewDialogComponent implements IBaseDialog, OnInit {
  dialogTitle = $localize`Stack preview`;
  dialogActions: Array<IAction> = [
    new DialogCallbackAction({
      name: $localize`Close`,
      primary: true,
      callback: () => this.dialogRef.close(),
    }),
  ];
  resourceValueFields = [
    'updated_time', 'creation_time', 'physical_resource_id', 'resource_action', 'resource_status',
    'resource_status_reason', 'resource_type', 'stack_name', 'description'
  ];

  resourceObjectFields = [
    'resource_identity', 'stack_identity', 'required_by', 'metadata', 'attributes', 'properties',
  ];

  constructor(
    public dialogRef: MatDialogRef<HeatStackPreviewDialogComponent>,
    @Inject(MAT_DIALOG_DATA) public data: IHeatStackPreviewModel,
  ) {
  }

  ngOnInit(): void {
  }

}
