- hello world
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/awesome_owl/static/src/todo/todoItem.js b/awesome_owl/static/src/todo/todoItem.js
new file mode 100644
index 00000000000..afc46c3cab8
--- /dev/null
+++ b/awesome_owl/static/src/todo/todoItem.js
@@ -0,0 +1,15 @@
+import { Component, markup } from "@odoo/owl";
+import { Counter } from "../counter/counter";
+
+export class TodoItem extends Component {
+ static template = "awesome_owl.todoItem";
+ static components = { Counter };
+ static props = {
+ id: { type: Number },
+ description: { type: String },
+ isCompleted: { type: Boolean},
+ toggleState: { type: Function, optional: true },
+ removeTodo: { type: Function, optional: true },
+ };
+
+}
diff --git a/awesome_owl/static/src/todo/todoItem.xml b/awesome_owl/static/src/todo/todoItem.xml
new file mode 100644
index 00000000000..cadd6b1366f
--- /dev/null
+++ b/awesome_owl/static/src/todo/todoItem.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/awesome_owl/static/src/todo/todoList.js b/awesome_owl/static/src/todo/todoList.js
new file mode 100644
index 00000000000..547a681e662
--- /dev/null
+++ b/awesome_owl/static/src/todo/todoList.js
@@ -0,0 +1,36 @@
+import { Component, useState } from "@odoo/owl";
+import { TodoItem } from "./todoItem";
+import { useAutoFocus } from "../utils";
+
+export class TodoList extends Component {
+ static template = "awesome_owl.todoList";
+ static components = { TodoItem };
+
+ setup() {
+ this.state = useState({todos: []});
+ this.idCounter = 1;
+ this.addTodoRef = useAutoFocus();
+ }
+
+ onAddTodo(ev) {
+ if (ev.key == "Enter" && ev.target.value.trim() !== "") {
+ const newTodo = {
+ id: this.idCounter++,
+ description: ev.target.value,
+ isCompleted: false,
+ };
+
+ this.state.todos.push(newTodo);
+ ev.target.value = "";
+ }
+ }
+
+ toggleState(todoId) {
+ const todo = this.state.todos?.find((t) => t.id === todoId);
+ if (todo) todo.isCompleted = !todo.isCompleted;
+ }
+
+ removeTodo(todoId) {
+ this.state.todos = this.state.todos?.filter((t) => t.id !== todoId);
+ }
+}
diff --git a/awesome_owl/static/src/todo/todoList.xml b/awesome_owl/static/src/todo/todoList.xml
new file mode 100644
index 00000000000..6a37f19dc81
--- /dev/null
+++ b/awesome_owl/static/src/todo/todoList.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/awesome_owl/static/src/utils.js b/awesome_owl/static/src/utils.js
new file mode 100644
index 00000000000..001515a3200
--- /dev/null
+++ b/awesome_owl/static/src/utils.js
@@ -0,0 +1,13 @@
+import { onMounted, useRef } from "@odoo/owl";
+
+export function useAutoFocus() {
+ const ref = useRef("add-todo-input");
+
+ onMounted(() => {
+ if (ref.el) {
+ ref.el.focus();
+ }
+ });
+
+ return ref;
+}