import { Pipe, PipeTransform } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';

@Pipe({
  name: 'bool',
})
export class BoolPipe implements PipeTransform {
  constructor(private translate: TranslateService) {}

  transform(value: unknown): string {
    return this.translate.instant(
      value === true || value === 'true' ? 'bool.true' : 'bool.false'
    );
  }
}
