All files / app/components/warning-modal warning-modal.ts

30% Statements 3/10
54.54% Branches 6/11
0% Functions 0/3
16.66% Lines 1/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                    1x                            
import { Component, inject, input } from '@angular/core';
import { LucideAngularModule, X } from 'lucide-angular';
import { ModalService } from '../../services/modal.service';
import { TranslocoModule } from '@jsverse/transloco';
 
export interface WarningModalData {
  title?: string;
  message: string;
  confirmText?: string;
  cancelText?: string;
}
 
@Component({
  selector: 'app-warning-modal',
  imports: [LucideAngularModule, TranslocoModule],
  templateUrl: './warning-modal.html',
  styleUrl: './warning-modal.scss',
})
export class WarningModal {
  private readonly modalService = inject(ModalService);
 
  readonly data = input<WarningModalData>();
  readonly icons = { X };
 
  cancel(): void {
    this.modalService.dismiss();
  }
 
  confirm(): void {
    this.modalService.close(true);
  }
}