import { Component, Input } from '@angular/core';
import { SimpleItem } from 'src/interfaces/simple-item';
import { DetailsService } from 'src/services/details/details.service';

@Component({
  selector: 'simple-item-details',
  templateUrl: './simple-item-details.component.html',
  styleUrl: './simple-item-details.component.scss',
})
export class SimpleItemDetailsComponent {
  public constructor(public detailsAccessor: DetailsService) {}
  @Input() item: SimpleItem = {
    name: '',
    weight: 0,
    value: 0,
    quantity: 0,
    description: '',
  };

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