import { Pipe, PipeTransform } from '@angular/core'; import { OptionModel } from '../models'; @Pipe({ name: 'inputDropdownLoadBrokerContainer', standalone: true, }) export class InputDropdownLoadBrokerContainerPipe implements PipeTransform { transform( option: OptionModel, options: OptionModel[], activeItem: OptionModel | null ): { [key: string]: boolean | undefined } { return { disabled: option?.disabled || option?.dnu || option?.ban || option?.availableCreditType?.name === 'Empty', 'no-result': options.length === 1 && options[0].type === 'no-resutls', 'add-new': option.type === 'add-new', active: option.id === activeItem?.id, }; } }