diff --git a/src/App.tsx b/src/App.tsx index d7a72df3..74ebab1a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,12 @@ import { useEffect, useState } from "react"; import type { Schema } from "../amplify/data/resource"; import { generateClient } from "aws-amplify/data"; +import { useAuthenticator } from '@aws-amplify/ui-react'; const client = generateClient(); function App() { + const { signOut } = useAuthenticator(); const [todos, setTodos] = useState>([]); useEffect(() => { @@ -17,21 +19,78 @@ function App() { client.models.Todo.create({ content: window.prompt("Todo content") }); } + function deleteTodo(id: string) { + client.models.Todo.delete({ id }) + } + + return ( -
-

My todos

- -
    - {todos.map((todo) => ( -
  • {todo.content}
  • - ))} -
-
- 🥳 App successfully hosted. Try creating a new todo. -
- - Review next step of this tutorial. - + +
+ +
+

Q Business Embedding

+
+ +
+

Things todo

+
+ +
+ + +
    + {todos.map((todo) => ( +
  • deleteTodo(todo.id)} key={todo.id}>{todo.content}
  • + ))} +
+
+ +
+

Powered Q Business

+ +
+ +
+
);