added date on chat
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user