export function createTextColumnFilter({ activeLabel, activeValue, loading = false, onChange, onReset, placeholder, value }) {
  return {
    activeLabel,
    activeValue,
    loading,
    onChange,
    onReset,
    placeholder,
    type: "text",
    value
  };
}

export function createTextFieldsColumnFilter({ activeLabel, activeValue, fields = [], loading = false, onChange, onReset }) {
  return {
    activeLabel,
    activeValue,
    fields,
    loading,
    onChange,
    onReset,
    type: "textFields"
  };
}

export function createUserIdentityColumnFilter({ activeLabel, activeValue, loading = false, onChange, onReset, value = {} }) {
  return createTextFieldsColumnFilter({
    activeLabel,
    activeValue,
    loading,
    onChange,
    onReset,
    fields: [
      {
        key: "displayUserId",
        label: "短 ID",
        placeholder: "输入短 ID",
        value: value.displayUserId
      },
      {
        key: "userId",
        label: "长 ID",
        placeholder: "输入长 ID",
        value: value.userId
      },
      {
        key: "username",
        label: "昵称",
        placeholder: "输入昵称",
        value: value.username
      }
    ]
  });
}

export function createOptionsColumnFilter({
  activeLabel,
  activeValue,
  emptyLabel,
  loading = false,
  onChange,
  onReset,
  options = [],
  placeholder,
  value
}) {
  return {
    activeLabel,
    activeValue,
    emptyLabel,
    loading,
    onChange,
    onReset,
    options,
    placeholder,
    value
  };
}
