import { AsyncPipe, CurrencyPipe } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { TourStateMeta } from '../../../core/data-access/graphql/generated/generated';

@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: 'dks-accounting-lane-footer',
  template: `@if (withTourCount) {
  <span class="text-left text-xs">
    {{ tourStateMeta.count }} Touren
  </span>
}
@if (withRevenueSum) {
  <span class="text-left text-xs">
    {{
    tourStateMeta.revenueSum
    | currency : 'EUR' : 'symbol' : '1.2-2' : 'de-DE'
    }}
  </span>
}`,
  host: {
    class: 'flex flex-col items-center justify-center p-2',
  },
  styles: [``],
  imports: [CurrencyPipe],
})
export class AccountingLaneFooterComponent {
  @Input() tourStateMeta!: TourStateMeta;
  @Input() withTourCount = true;
  @Input() withRevenueSum = false;
}
