export interface options {
  label: string;
  value: string | number;
  [property: string]: any;
}
export interface optionObject {
  [property: string]: options[];
}
const options: optionObject = {
  type: [
    { label: "正常日志", value: "info" },
    { label: "异常日志", value: "error" },
  ],
};

export const switchAttr = {
  "active-value": 1,
  "inactive-value": 0,
}


export type optionsType = string;

export function returnOptions(type: optionsType) {
  return options[type];
}

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

