import { Component, Input } from '@angular/core';
import { Food } from 'src/interfaces/food';
import { DetailsService } from 'src/services/details/details.service';

@Component({
  selector: 'app-food-details',
  templateUrl: './food-details.component.html',
  styleUrl: './food-details.component.scss',
})
export class FoodDetailsComponent {
  public constructor(public detailsAccessor: DetailsService) {}

  @Input() item: Food = {
    name: '',
    weight: 0,
    quantity: 0,
    isReady: false,
  };

  public close(result: string): void {
    this.detailsAccessor.closePanel(result);
  }
}
