import { Pipe, PipeTransform } from '@angular/core';
import { TreeNodeModel, TreeNodesSelectorService } from '../services/tree-nodes-selector.service';

@Pipe({
  name: 'ariaLabelTextForExpansionBtn',
})
export class AriaLabelTextForExpansionBtnPipe implements PipeTransform {
  constructor(private treeNodesSelectorService: TreeNodesSelectorService) {}

  transform(treeNode: TreeNodeModel, parentTreeNode: TreeNodeModel, expandedChildUuid: string): string {
    return this.treeNodesSelectorService.getAriaLabelTextForExpansionButton(
      parentTreeNode,
      treeNode,
      expandedChildUuid
    );
  }
}
