import { useEffect, useRef } from "react" import { Bot, User } from "lucide-react" export default function ChatWindow({ messages, loading }) { const bottomRef = useRef(null) useEffect(() => { bottomRef.current?.scrollIntoView({ behavior: "smooth" }) }, [messages, loading]) const today = new Date().toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", }) return (
Today, {today}
{messages.map((msg, i) => (
{msg.imageUrl && ( uploaded medicine )} {msg.text && {msg.text}}
))} {loading && (
{[0, 1, 2].map(i => (
))}
)}
) }