🎨 Add animations

This commit is contained in:
adam.watkins
2023-04-08 11:05:18 +03:00
parent 3169318c88
commit 840d54ff75
7 changed files with 44 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ import cx from "classnames";
import type { ReactNode } from "react";
import React, { useEffect, useRef } from "react";
import { FaBrain, FaListAlt, FaPlayCircle, FaStar } from "react-icons/fa";
import autoAnimate from "@formkit/auto-animate";
interface ChatWindowProps {
children?: ReactNode;
@@ -19,6 +20,10 @@ const ChatWindow = ({ messages, children, className }: ChatWindowProps) => {
}
});
useEffect(() => {
scrollRef.current && autoAnimate(scrollRef.current);
}, [messages]);
return (
<div
className={