
export const discountTypeOptions: options[] = [
  { label: "金额", value: "0" },
  { label: "折扣", value: "1" },
];


export type optionsType = "discountType" | "";

export function returnOptions(type: optionsType) {
  if (type === "discountType") {
    return discountTypeOptions;
  }
}

export function returnOptionsLabel(optionsType: optionsType, value: string | number) {
  const options = returnOptions(optionsType);
  if (!options) {
    return "";
  }
  const option = options.find((item) => item.value === value);
  return option ? option.label : "";
}

export interface options {
  label: string;
  value: string | number;
  [property: string]: any;
}
