import {Component, EventEmitter, Input, Output} from '@angular/core';
import {UNIT_GALLON, UNIT_LITER, UNIT_MILLILITER} from "../../../shared/units";

@Component({
  selector: 'cre-unit-selector',
  templateUrl: './unit-selector.component.html',
  styleUrls: ['./unit-selector.component.sass']
})
export class UnitSelectorComponent {
  readonly unitConstants = {UNIT_MILLILITER, UNIT_LITER, UNIT_GALLON}

  @Input() unit = UNIT_MILLILITER
  @Input() showLabel = true
  @Input() short = false

  @Output() unitChange = new EventEmitter<string>()
}
