import {
  DELIVERY_CARRIERS as SHARED_DELIVERY_CARRIERS,
  DELIVERY_CARRIER_LABELS,
  deliveryCarrierLabelRu as sharedDeliveryCarrierLabelRu,
} from '@shared/constants/delivery-carrier'

export const DELIVERY_CARRIER_CODES = SHARED_DELIVERY_CARRIERS as typeof SHARED_DELIVERY_CARRIERS

export type DeliveryCarrierCode = (typeof DELIVERY_CARRIER_CODES)[number]

export const DELIVERY_CARRIER_OPTIONS: ReadonlyArray<{ code: DeliveryCarrierCode; label: string }> =
  DELIVERY_CARRIER_CODES.map((code) => ({
    code,
    label: DELIVERY_CARRIER_LABELS[code],
  }))

export function deliveryCarrierLabelRu(code: string | null | undefined): string | null {
  return sharedDeliveryCarrierLabelRu(code)
}
