36 lines
957 B
TypeScript
36 lines
957 B
TypeScript
import { Component, inject, Input } from "@angular/core";
|
|
import { MatRippleModule } from "@angular/material/core";
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
|
|
|
|
export interface ConfirmationDialogData {
|
|
title: string;
|
|
description: string;
|
|
}
|
|
|
|
@Component({
|
|
selector: 'app-confirmation-dialog',
|
|
standalone: true,
|
|
templateUrl: './confirmation-dialog.component.html',
|
|
styleUrl: './confirmation-dialog.component.scss',
|
|
imports: [MatRippleModule]
|
|
})
|
|
export class ConfirmationDialog {
|
|
private readonly dialogRef = inject(MatDialogRef<ConfirmationDialog>);
|
|
data: ConfirmationDialogData = inject(MAT_DIALOG_DATA);
|
|
|
|
get title(): string {
|
|
return this.data.title;
|
|
}
|
|
|
|
get description(): string {
|
|
return this.data.description;
|
|
}
|
|
|
|
closeAndValidate(): void {
|
|
this.dialogRef.close(true);
|
|
}
|
|
|
|
closeDialog(): void {
|
|
this.dialogRef.close(false);
|
|
}
|
|
} |