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

@Pipe({
  name: 'taskStatusMapping',
})
export class TaskStatusPipe implements PipeTransform {
  statusMapping: { [key: string]: string } = {
    Overdue: 'Überfällig',
    InProgress: 'In Bearbeitung',
    Completed: 'Abgeschlossen',
    Open: 'Offen',
    ['Overdue|Open']: 'Offen',
    ['Overdue|InProgress']: 'In Bearbeitung',
  };

  transform(status: Task['status']): string {
    return this.statusMapping[status];
  }
}
