diff --git a/src/main/webapp/src/components/todo_list.js b/src/main/webapp/src/components/todo_list.js
index 11e682d..a1f7635 100644
--- a/src/main/webapp/src/components/todo_list.js
+++ b/src/main/webapp/src/components/todo_list.js
@@ -1,6 +1,7 @@
import React, { useContext, useMemo } from 'react';
import { TodosContext } from "../context/todos_context";
import Todo from './todo';
+import TodoListControls from './todo_list_controls';
const TodoList = function () {
const { todos, toggleAll } = useContext(TodosContext);
@@ -21,6 +22,7 @@ const TodoList = function () {
))}
+
);
}
diff --git a/src/main/webapp/src/components/todo_list_controls.js b/src/main/webapp/src/components/todo_list_controls.js
new file mode 100644
index 0000000..c514fde
--- /dev/null
+++ b/src/main/webapp/src/components/todo_list_controls.js
@@ -0,0 +1,39 @@
+import React, { useMemo, useContext } from 'react';
+import { TodosContext } from "../context/todos_context";
+
+const TodoListControls = function (props) {
+ const { todos, clearCompleted } = useContext(TodosContext);
+
+ const itemsLeft = useMemo(() => todos.reduce((p, c) => p + (c.completed ? 0 : 1), 0), [
+ todos
+ ]);
+
+ const itemsCompleted = useMemo(() => todos.length - itemsLeft, [
+ todos, itemsLeft
+ ]);
+
+ return (
+
+ );
+}
+
+export default TodoListControls;
\ No newline at end of file