import { create } from "zustand";
const useTaskStore = create((set, get) => ({
  tasks: [],
  setTasks: (tasks) => set({ tasks }),
  addTask: (task) => set((state) => ({
    tasks: [...state.tasks, task]
  })),
  updateTask: (id, updates) => set((state) => ({
    tasks: state.tasks.map(
      (task) => task.id === id ? { ...task, ...updates } : task
    )
  })),
  removeTask: (id) => set((state) => ({
    tasks: state.tasks.filter((task) => task.id !== id)
  })),
  getTaskById: (id) => get().tasks.find((task) => task.id === id),
  getTasksByState: (state) => get().tasks.filter((task) => task.state === state)
}));
export {
  useTaskStore
};
//# sourceMappingURL=task-store.js.map
