From 5c04de16d4159903a8eaceffa241e7b33cdcbf67 Mon Sep 17 00:00:00 2001 From: Spencer Lochne Date: Tue, 10 Jun 2025 12:49:30 -0400 Subject: [PATCH] 11j Solution --- .../components/{ChatInput.jsx => ChatInput.tsx} | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) rename 2-copy-of-code/lesson-11/chatbot-project/src/components/{ChatInput.jsx => ChatInput.tsx} (74%) diff --git a/2-copy-of-code/lesson-11/chatbot-project/src/components/ChatInput.jsx b/2-copy-of-code/lesson-11/chatbot-project/src/components/ChatInput.tsx similarity index 74% rename from 2-copy-of-code/lesson-11/chatbot-project/src/components/ChatInput.jsx rename to 2-copy-of-code/lesson-11/chatbot-project/src/components/ChatInput.tsx index 95829c6..254dc8b 100644 --- a/2-copy-of-code/lesson-11/chatbot-project/src/components/ChatInput.jsx +++ b/2-copy-of-code/lesson-11/chatbot-project/src/components/ChatInput.tsx @@ -2,7 +2,20 @@ import { useState } from 'react' import { Chatbot } from 'supersimpledev'; import './ChatInput.css'; -export function ChatInput({ chatMessages, setChatMessages }) { +type ChatInputProps = { + chatMessages: { + message: string; + sender: string; + id: string; + }[]; + setChatMessages: (chatMessages: { + message: string; + sender: string; + id: string; + }[]) => void; +}; + +export function ChatInput({ chatMessages, setChatMessages }: ChatInputProps) { const [inputText, setInputText] = useState(''); function saveInputText(event) {