Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLParagraphElement | null>(null);

Expand Down