import { Component, computed, inject } from '@angular/core'; import { toSignal } from '@angular/core/rxjs-interop'; import { ActivatedRoute } from '@angular/router'; import { map } from 'rxjs'; import { ChipComponent, type ChipVariant } from '@africanies/africanies-ui'; import { findUsecaseShipment } from './shipment-data'; /** * Child detail route — Back returns to the shipment list parent. */ @Component({ selector: 'app-shipment-detail-page', standalone: true, imports: [ChipComponent], template: `
@if (shipment(); as row) {

Shipment

{{ row.reference }}

{{ row.route }}

{{ row.status }}
Origin
{{ row.origin }}
Destination
{{ row.destination }}
Updated
{{ row.updated }}

The chevron and breadcrumbs above are provided by the SDK — this page does not add them. List filters and page stay on the query string; Back returns to /usecases/shipment with those queries intact. Paste /usecases/shipment/{{ row.reference }} in a new tab and Back still appears.

} @else {

Unknown shipment.

}
`, }) export class ShipmentDetailPage { private readonly route = inject(ActivatedRoute); private readonly reference = toSignal( this.route.paramMap.pipe(map((params) => params.get('id') ?? '')), { initialValue: this.route.snapshot.paramMap.get('id') ?? '' }, ); protected readonly shipment = computed(() => findUsecaseShipment(this.reference()), ); protected statusVariant(status: string): ChipVariant { switch (status) { case 'Delivered': return 'success'; case 'Exception': return 'danger'; case 'Pending': return 'warning'; default: return 'neutral'; } } }