import { ChangeDetectionStrategy, Component, inject } from '@angular/core';

import {
  SimpleModalData,
  MODAL_DATA,
  ModalRef
} from '../../../core/services/modal.service';
import { ButtonComponent } from '../button/button.component';

@Component({
  selector: 'app-simple-modal',
  imports: [ButtonComponent],
  templateUrl: './simple-modal.component.html',
  styleUrl: './simple-modal.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class SimpleModalComponent {
  protected readonly data = inject<SimpleModalData>(MODAL_DATA);
  private readonly modalRef = inject<ModalRef<void>>(ModalRef);

  protected close(): void {
    this.modalRef.close();
  }
}
