import type { SelectOption } from "./types";

/** Gets the human-readable representation of a `value`. */
export const fetchItemLabel = (
  options: SelectOption[],
  value: string
): string => {
  const foundItem = options.find((item) => item.value === value);

  return foundItem ? foundItem.label : "";
};
