AI Frontend · Exercise 1 of 6Next
Beginner
Show a Chat with useChat
The route /api/chat is ready. The page has a button #ask, a list #messages and a line #status. Use useChat so that clicking #ask sends the message How long does shipping take?.
Show every message of the chat inside #messages as one <p> per message (the text of its text parts), and show the chat's status in #status.
What Check tests
- Before the click,
#statussaysreadyand#messagesis empty - Right after the click the question is in
#messagesand#statusis no longerready - At the end there are two messages and
#statussaysready
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.