Add confirmation dialog to delete publications.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { Component, inject, Input } from "@angular/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: []
|
||||
})
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user