import { CONDITION_ENUM_AND } from '../constants';

const createEmptyRules = ({ uiIndex, indexInArray }) => ({
  ruleId: undefined,
  ruleName: `Share videos rule ${indexInArray}`,
  ruleOrder: undefined,
  ruleSelectType: [
    {
      type: '', // one of RULE_TYPE see in constance.js
      value: [],
      condition: CONDITION_ENUM_AND,
    },
  ],
  ruleShareWithType: [
    {
      type: '', // one of SHARE_WITH_TYPE see in constance.js
      value: [],
    },
  ],
  initialFromApi: null,
  // options
  sourcesOptions: null,
  hubsOptions: null,
  usersOptions: null,
  // ui state
  uiIndex,
  uiIsOpen: true,
  uiIsSaved: false,
  uiIsNameInEditMode: true,
});

export default createEmptyRules;
