
import {
  ChangeDetectionStrategy,
  Component,
  EventEmitter,
  Input,
  Output,
} from '@angular/core';
import {
  TicketFilterArgs,
  TicketValidationState,
} from '../../../core/data-access/graphql/generated/generated';
import { TicketLaneHeaderFilterComponent } from './ticket-lane-header-filter.component';

@Component({
    changeDetection: ChangeDetectionStrategy.OnPush,
    selector: 'dks-ticket-lane-header',
    template: `<div></div>
@switch (state) {
  @case (TicketValidationState.Created) {
    <div>Touren angenommen</div>
  }
  @case (TicketValidationState.UserInteractionRequired) {
    <div>
      Genehmigung/Transportschein
    </div>
  }
  @case (TicketValidationState.TdUncertain) {
    <div>
      Transportschein unklar
    </div>
  }
  @case (TicketValidationState.DocumentsMissing) {
    <div>
      Dokumente fehlen
    </div>
  }
  @case (TicketValidationState.Archived) {
    <div>Archiv</div>
  }
}
<dks-ticket-lane-header-filter
  [state]="state"
  (filterChange)="filterChanged($event)"
></dks-ticket-lane-header-filter>`,
    host: {
      class: 'flex items-center justify-between p-2',
    },
    styles: [
        `
      :host {
        color: var(--mat-sys-on-secondary-container);
        background-color: var(--mat-sys-secondary-container);
      }
    `,
    ],
    imports: [TicketLaneHeaderFilterComponent]
})
export class TicketLaneHeaderComponent {
  @Input() state!: TicketValidationState;
  @Output() filterChange = new EventEmitter<TicketFilterArgs>();

  TicketValidationState = TicketValidationState;

  filterChanged(filter: TicketFilterArgs) {
    this.filterChange.emit(filter);
  }
}
