update chat

This commit is contained in:
Ren Amamiya
2023-04-28 15:20:10 +07:00
parent 87e8ee8954
commit f751c1f18f
20 changed files with 183 additions and 438 deletions

View File

@@ -0,0 +1,27 @@
import ChatMessageUser from '@lume/app/chat/components/messages/user';
import { useDecryptMessage } from '@lume/utils/hooks/useDecryptMessage';
import { memo } from 'react';
export const ChatMessageItem = memo(function MessageListItem({
data,
userPubkey,
userPrivkey,
}: {
data: any;
userPubkey: string;
userPrivkey: string;
}) {
const content = useDecryptMessage(userPubkey, userPrivkey, data.pubkey, data.tags, data.content);
return (
<div className="flex h-min min-h-min w-full select-text flex-col px-5 py-2 hover:bg-black/20">
<div className="flex flex-col">
<ChatMessageUser pubkey={data.pubkey} time={data.created_at} />
<div className="-mt-[17px] pl-[48px]">
<div className="whitespace-pre-line break-words break-words text-sm leading-tight">{content}</div>
</div>
</div>
</div>
);
});