import { Component, Input, Output, EventEmitter } from '@angular/core';
import { ChartTemplate } from '../chart-config-manager.component';

@Component({
  selector: 'app-chart-template-form',
  templateUrl: './chart-template-form.component.html',
  styleUrls: ['./chart-template-form.component.scss']
})
export class ChartTemplateFormComponent {
  @Input() chartTemplate: Partial<ChartTemplate> = {};
  @Input() isEdit = false;
  @Output() save = new EventEmitter<Partial<ChartTemplate>>();
  @Output() cancel = new EventEmitter<void>();

  onSubmit(): void {
    this.save.emit(this.chartTemplate);
  }

  onCancel(): void {
    this.cancel.emit();
  }
}