diff --git a/src/components/Chat/Chat.tsx b/src/components/Chat/Chat.tsx index 3898051..0ed8143 100644 --- a/src/components/Chat/Chat.tsx +++ b/src/components/Chat/Chat.tsx @@ -41,9 +41,23 @@ const createMessage = (text: string, isUserMessage: boolean): Message => { }; }; + + export default function Chat() { + + useEffect(() => { + // Implement the recursive function that sums an array of integers + const recursiveArraySum = (arr: number[]): number => { + if (arr.length === 0) { + return 0; + } + return arr[0] + recursiveArraySum(arr.slice(1)); + }; + }, []); + const userId = useAtomValue(chatUserIdAtom); + // ref to track text area and scroll text into view const ref = useRef(null);