import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'nullValue'
})
export class NullValuePipe implements PipeTransform {
  transform(value: any, placeholderType: string = 'n/a'): unknown {
    if (value) {
      return value;
    }
    switch (placeholderType) {
      case 'none':
        return $localize`(none)`;
      default:
        return $localize`n/a`;
    }
  }

}
