2022-01-19 17:24:11 +01:00
|
|
|
import { Component, Inject } from '@angular/core';
|
|
|
|
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
|
|
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
export interface DialogData {
|
|
|
|
title: string;
|
|
|
|
description: string;
|
|
|
|
showActionButtons: boolean;
|
|
|
|
}
|
2022-03-23 13:48:17 +01:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2022-01-19 17:24:11 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'ov-dialog-template',
|
|
|
|
template: `
|
|
|
|
<h1 mat-dialog-title>{{ data.title }}</h1>
|
|
|
|
<div mat-dialog-content>{{ data.description }}</div>
|
|
|
|
<div mat-dialog-actions *ngIf="data.showActionButtons">
|
|
|
|
<button mat-button (click)="close()">Close</button>
|
|
|
|
</div>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
export class DialogTemplateComponent {
|
|
|
|
constructor(public dialogRef: MatDialogRef<DialogTemplateComponent>, @Inject(MAT_DIALOG_DATA) public data: DialogData) {}
|
|
|
|
|
|
|
|
close() {
|
|
|
|
this.dialogRef.close();
|
|
|
|
}
|
|
|
|
}
|