/** * Polderfest 2027 — chat pagina * -------------------------------------------------- * Les 11 — useChat hook + Tailwind chat UI. * Plaats dit bestand op: app/chat/page.tsx * * Werking: * - useChat() regelt messages, input, submit-handler, streaming * - Praat met /api/chat (de route.ts) * - Disabled tijdens streaming * * Vereist: * - app/api/chat/route.ts (zie route.ts) * - npm i ai * - Tailwind aanwezig in project (standaard in create-next-app) */ "use client"; import { useChat } from "ai/react"; export default function ChatPage() { const { messages, input, handleInputChange, handleSubmit, status } = useChat(); return (

Polderfest 2027 — vraag de AI

{messages.map((m) => (
{m.role === "user" ? "Jij" : "Festival AI"}
{m.content}
))}
); }