ChemPal Documentation - v1.6.0
    Preparing search index...

    Function availabilityLabel

    • Localized label for an availability value (see isAvailability). Also covers the drawer's grouped filter codes (in_stock, out_of_stock, …), which are a subset of the enum values. Falls back to the raw value for anything outside the known set.

      Parameters

      • value: string

        The availability value.

      Returns string

      The translated label, or the raw value if unrecognized.

      availabilityLabel("in_stock"); // => "In Stock" (en) / "Dostępny" (pl)
      
      export function availabilityLabel(value: string): string {
      return isAvailability(value) ? i18n(`availability_${value}`) : value;
      }