import { useState } from 'react'; export default function Counter() { const [customText, setCustomText] = useState(""); const [selectedGesture, setSelectedGesture] = useState("animations/Stand/BodyTalk/Speaking/BodyTalk_1"); // Reusable helper to talk to the backend const send = async (type: string, context: string) => { try { await fetch("http://localhost:8000/button_pressed", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ type, context }), }); // Backticks restored here: console.log(`Sent ${type}: ${context}`); } catch (err) { // Backticks restored here: console.error(`Error sending ${type}:`, err); } }; function list_generator(header: string, items: string[]) { return (
{header}
); } return (
setCustomText(e.target.value)} placeholder="Type something for Pepper to say..." style={{ padding: '8px', flex: 1 }} />
{list_generator("Goals to complete:", ["Greet user", "Introduce self", "Ask for name"])} {list_generator("Conditional norms:", ["If {user_tired}, be less energetic", "If {play_mundo}, go where you please"])} {list_generator("Activate triggers:", ["If {user_thirsty}, offer drink", "If {name == Karen}, be triggered"])}
); }