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

@Pipe({
  name: 'cleanFilename',
  standalone: true
})
export class CleanFilenamePipe implements PipeTransform {

  transform(value: string | null | undefined): string {
    if(!value){
      return '';
    }
    const endPerfixIndex = value.indexOf('_');
    if(endPerfixIndex != -1){
      return value.substring(endPerfixIndex + 1);
    }
    return value;
  }

}
