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

import { CollectionView } from "@bitwarden/admin-console/common";

@Pipe({
  name: "collectionNameFromId",
  pure: true,
})
export class GetCollectionNameFromIdPipe implements PipeTransform {
  transform(value: string, collections: CollectionView[]) {
    return collections.find((o) => o.id === value)?.name;
  }
}
