import {
  ADD_TASK,
  ADD_CDB_TASK,
  ADD_TASK_PARENT,
  TOGGLE_COMPLETED,
  SET_FILTER,
  SELECT_PROJECT,
  ADD_PROJECT,
  DELETE_PROJECT,
  ARCHIVE_PROJECT,
  DELETE_TASK,
} from "./actionTypes";



export const addTask = (taskName) => ({
  type: ADD_TASK,
  payload: { taskName },
});

export const addCdbTask = (taskName) => ({ 
  type: ADD_CDB_TASK,
  payload: { taskName },
});


export const addTaskParent = (id) => ({
  type: ADD_TASK_PARENT,
  payload: { id },
});

export const deleteTask = (id) => ({
  type: DELETE_TASK,
  payload: { id },
});

export const toggleCompleted = (id) => ({
  type: TOGGLE_COMPLETED,
  payload: { id },
});

export const setFilter = (filter) => ({
  type: SET_FILTER,
  payload: { filter },
});

export const addProject = (projectName) => ({
  type: ADD_PROJECT,
  payload: { projectName },
});

export const deleteProject = (id) => ({
  type: DELETE_PROJECT,
  payload: { id },
});

export const selectProject = (id) => ({
  type: SELECT_PROJECT,
  payload: { id },
});

export const archiveProject = (id) => ({
  type: ARCHIVE_PROJECT,
  payload: { id },
});

