diff --git a/src/components/components.tsx b/src/components/components.tsx index 6450f5a..7ee7f0d 100644 --- a/src/components/components.tsx +++ b/src/components/components.tsx @@ -1,113 +1,25 @@ -import { useState } from 'react'; +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} - -
- ); - } +/** + * A minimal counter component that demonstrates basic React state handling. + * + * Maintains an internal count value and provides buttons to increment and reset it. + * + * @returns A JSX element rendering the counter UI. + */ +function Counter() { + /** The current counter value. */ + const [count, setCount] = useState(0) 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"])} -
+
+ +
- ); -} \ No newline at end of file + ) +} +export default Counter \ No newline at end of file