From 95278dc7422248525044b08008d462f057cbf6ef Mon Sep 17 00:00:00 2001 From: Deveshi Dwivedi Date: Thu, 27 Jun 2024 20:02:26 +0530 Subject: [PATCH] create message component --- modules/room/components/chat/Message.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/room/components/chat/Message.tsx diff --git a/modules/room/components/chat/Message.tsx b/modules/room/components/chat/Message.tsx new file mode 100644 index 0000000..5d52a06 --- /dev/null +++ b/modules/room/components/chat/Message.tsx @@ -0,0 +1,16 @@ +import {socket} from "@/common/lib/socket"; + +const Message = ({ userId, msg, username, color}: Message) =>{ + const me= socket.id===userId; + return ( +
+ {!me && ( +
{username}
+ )} +

{msg}

+
+ ); +}; +export default Message; \ No newline at end of file