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

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

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

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