import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Dialog } from 'primeng/dialog';

@Component({
  selector: 'shared-dialog',
  template: `
    <p-dialog
      [header]="header"
      [(visible)]="visible"
      [modal]="modal"
      [style]="style"
      [closable]="closable"
      [draggable]="draggable"
      [breakpoints]="breakpoints"
      (onHide)="onHide.emit($event)"
    >
      <ng-content />
    </p-dialog>
  `,
  imports: [Dialog],
})
export class SharedDialogComponent {
  @Input() header = '';
  @Input() visible = false;
  @Output() visibleChange = new EventEmitter<boolean>();

  @Input() modal = true;
  @Input() closable = true;
  @Input() draggable = false;
  @Input() style: Record<string, string> | undefined;
  @Input() breakpoints: Record<string, string> | undefined;

  @Output() onHide = new EventEmitter<any>();
}
