fixed jazz things

This commit is contained in:
Nikita
2024-09-19 20:21:59 +03:00
parent fdb73a2522
commit da4f018bbd
6 changed files with 23 additions and 23 deletions

View File

@@ -7,13 +7,8 @@ import { TaskForm } from "./TaskForm"
export const TaskRoute: React.FC = () => {
const { me } = useAccount({ root: { tasks: [] } })
const tasks = me?.root?.tasks || []
const addTask = (newTask: Task) => {
if (me?.root?.tasks) {
me.root.tasks.push(newTask)
}
}
const tasks = me?.root.tasks
console.log(tasks, "tasks here")
const updateTask = (taskId: string, updates: Partial<Task>) => {
if (me?.root?.tasks) {
@@ -27,8 +22,8 @@ export const TaskRoute: React.FC = () => {
return (
<div className="flex flex-col space-y-4 p-4">
<h1 className="text-2xl font-bold">Tasks</h1>
<TaskForm onAddTask={addTask} />
<TaskList tasks={tasks as Task[]} updateTask={updateTask} />
<TaskForm />
<TaskList tasks={tasks} onUpdateTask={updateTask} />
</div>
)
}