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

@Pipe({
  name: 'addToPreviousCompartmentCodeLabelPipe',
  standalone: true,
})
export class PickupShelfAddToPreviousCompartmentCodeLabelPipe implements PipeTransform {
  transform(compartmentCode: string): string {
    const compartmentCodeSplit = compartmentCode?.split('_');
    compartmentCodeSplit?.shift();
    return compartmentCodeSplit?.join('_');
  }
}
