import { ChangeDetectionStrategy, Component, input } from '@angular/core';
import { DatePipe } from '@angular/common';
import { TranslatePipe } from '../../../../../i18n/translate.pipe';

export interface OrderTimelineEntry {
  status?: string;
  timestamp: string;
  /** Pre-resolved, already-translated display text for this event. */
  note: string;
  orderNumber?: string;
  actor?: string;
}

/** Reusable vertical event timeline - used on both the order detail page and the customer activity tab. */
@Component({
  selector: 'app-order-timeline',
  standalone: true,
  imports: [DatePipe, TranslatePipe],
  templateUrl: './order-timeline.component.html',
  styleUrl: './order-timeline.component.scss',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class OrderTimelineComponent {
  readonly entries = input.required<OrderTimelineEntry[]>();
  readonly showOrderNumber = input(false);
}
