import { Component, Input, OnInit } from '@angular/core';
import { UpdateApplicationComponent } from 'src/app/applications/update-application/update-application.component';
import { Application } from '../../entities/Application';
import { ApplicationStatus } from '../../entities/ApplicationStatus';
import { ApplicationService } from '../../services/application.service';
import { ModalService } from '../../services/modal.service';

interface AppDisplaying {
  name: string,
  image: string,
  status: string
}

@Component({
  selector: 'app-application-card',
  templateUrl: './application-card.component.html',
  styleUrls: ['./application-card.component.scss']
})
export class ApplicationCardComponent {
  @Input() applicationStatus: ApplicationStatus | undefined;

  constructor(
    private _applicationService: ApplicationService,
    private _modalService: ModalService
  ) {}

  edit(): void {
    this._modalService.open(UpdateApplicationComponent, this.applicationStatus?.application);
  }
}
