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

/** finished — без классов (дефолт Taiga). */
@Pipe({
  name: 'sessionStatusChipClasses',
  standalone: true,
})
export class SessionStatusChipClassesPipe implements PipeTransform {
  transform(value: string | null | undefined): Record<string, boolean> {
    const k = value?.trim().toLowerCase() ?? '';
    if (k === '' || k === 'finished') {
      return {};
    }
    if (k === 'active') {
      return { 'status-chip--active': true };
    }
    if (k === 'pending') {
      return { 'status-chip--pending': true };
    }
    return { 'status-chip--unknown': true };
  }
}
