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

@Pipe({
  name: 'showTags',
})
export class ShowTagsPipe implements PipeTransform {
  constructor() {}
  transform(actions: KeyValueDTOOfStringAndString[]): boolean {
    if (!Array.isArray(actions)) {
      return false;
    }
    const result = actions.some((action) => action.command.includes('ARRIVED'));

    return result;
  }
}
