initial commit

This commit is contained in:
azykov@mail.ru
2026-08-25 17:07:55 +03:00
commit cfae2d91f4
29 changed files with 2749 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { useEffect } from "react";
import { observer } from "mobx-react-lite";
import { todoStore } from "../stores/TodoStore";
import { TodoList } from "./TodoList"
import './TodoView.scss';
export const TodoView = observer(function TodoView() {
useEffect(() => {
void todoStore.refresh();
}, []);
return (
<div>
<button type="button" onClick={() => void todoStore.refresh()} disabled={todoStore.loading}>
{todoStore.loading ? "Refreshing…" : "Refresh"}
</button>
{todoStore.error && <p>Failed to load todos: {todoStore.error}</p>}
{!todoStore.error && <TodoList items={todoStore.items} />}
</div>
);
});