import { Component, OnInit,Inject  } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';

@Component({
  selector: 'app-dialog-component',
  template: `
    <h2 mat-dialog-title>Declaration:</h2>
    <mat-dialog-content>
      <ul>
        <li *ngFor="let detail of details">{{ detail }}</li>
      </ul>
    </mat-dialog-content>
    <mat-dialog-actions>
      <!-- <button mat-button style="    color: #46AC9E;" (click)="onAccept()">Accept</button> -->
      <a style="color: #46AC9E;margin-right: 18px;cursor:pointer" (click)="onAccept()">Close</a>
      <!-- <button mat-button (click)="onClose()">Close</button> -->
      <!-- <a style="margin-right: 10px;cursor:pointer" (click)="onClose()">Close</a> -->

    </mat-dialog-actions>
  `,
  styleUrls: ['./dialog.component.scss']
})
export class DialogComponent implements OnInit {

  details: string[];

  constructor(
    public dialogRef: MatDialogRef<DialogComponent>,
    @Inject(MAT_DIALOG_DATA) public data: { details: string[] }
  ) {
    this.details = data.details;
  }

  onAccept() {
    // You can perform any actions needed when the user accepts the terms and conditions here.
    this.dialogRef.close('accepted');
  }

  onClose() {
    // You can perform any actions needed when the user closes the dialog without accepting the terms and conditions here.
    this.dialogRef.close('closed');
  }
  ngOnInit(): void {
    
  }
}
