added date on chat

This commit is contained in:
SlimusMinus
2026-08-13 00:52:56 +03:00
parent 7b87dbe5c5
commit 053b7b52ad
4 changed files with 45 additions and 2 deletions

View File

@@ -1,7 +1,14 @@
import { useTranslation } from "react-i18next";
import { formatMessageTime } from "../../utils/chatDisplay";
export default function MessageBubble({ message, isMine }) {
const { i18n } = useTranslation();
const time = formatMessageTime(message.createdAt, i18n.language);
return (
<div className={`chat-bubble${isMine ? " mine" : ""}`}>
{message.content}
{time && <div className="chat-bubble-time">{time}</div>}
</div>
);
}
}