import { property } from "lodash";

export const statusOptions: options[] = [
  { label: "全部", value: '' },
  { label: "启用", value: 1 },
  { label: "禁用", value: 0 },
];


export type optionsType = "status";

export function returnOptions(type: optionsType) {
  if (type === "status") {
    return statusOptions;
  }
}

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;
}
