import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Advice } from 'src/app/interfaces/advice.interface';

interface Attached{
  id: string;
  name: string;
  size: string;
}

@Component({
  selector: 'app-advice-alert',
  templateUrl: './advice-alert.component.html',
  styleUrls: ['./advice-alert.component.css']
})
export class AdviceAlertComponent implements OnInit {
  dataSource: Attached[] = [];
  displayedColumns: string[] = ['name', 'size', 'actions'];

  constructor(@Inject(MAT_DIALOG_DATA) public data: Advice) { }

  ngOnInit(): void {
    let attachedArr: Attached[] = JSON.parse(this.data.ADJUNTOS);
    this.dataSource = attachedArr;
  }

}
