diff --git a/frontend/src/components/ChatBox.jsx b/frontend/src/components/ChatBox.jsx
new file mode 100644
index 0000000..5ef4252
--- /dev/null
+++ b/frontend/src/components/ChatBox.jsx
@@ -0,0 +1,47 @@
+import PropTypes from 'prop-types';
+
+const ChatBox = ({ activeChat }) => {
+ if (!activeChat) {
+ return (
+
+
Select a chat to start messaging
+
+ );
+ }
+
+ return (
+
+ {/* Chat Header */}
+
+
{activeChat.name}
+
+
+ {/* Chat Messages */}
+
+
+ {activeChat.message}
+
+ {/* Add more messages as needed */}
+
+
+ {/* Message Input */}
+
+
+
+
+ );
+};
+
+ChatBox.propTypes = {
+ activeChat: PropTypes.shape({
+ id: PropTypes.number.isRequired,
+ name: PropTypes.string.isRequired,
+ message: PropTypes.string.isRequired,
+ }),
+};
+
+export default ChatBox;
\ No newline at end of file
diff --git a/frontend/src/components/ChatList.jsx b/frontend/src/components/ChatList.jsx
new file mode 100644
index 0000000..41e063d
--- /dev/null
+++ b/frontend/src/components/ChatList.jsx
@@ -0,0 +1,34 @@
+import PropTypes from 'prop-types';
+
+const ChatList = ({ contacts, onSelectChat }) => {
+ return (
+
+
Chats
+
+ {contacts.map((contact) => (
+ - onSelectChat(contact)}
+ className="p-4 border-b hover:bg-gray-200 cursor-pointer"
+ >
+
{contact.name}
+ {contact.message}
+
+ ))}
+
+
+ );
+};
+
+ChatList.propTypes = {
+ contacts: PropTypes.arrayOf(
+ PropTypes.shape({
+ id: PropTypes.number.isRequired,
+ name: PropTypes.string.isRequired,
+ message: PropTypes.string.isRequired,
+ })
+ ).isRequired,
+ onSelectChat: PropTypes.func.isRequired,
+};
+
+export default ChatList;
\ No newline at end of file
diff --git a/frontend/src/components/Navbar.jsx b/frontend/src/components/Navbar.jsx
index 5fdb970..9067a6b 100644
--- a/frontend/src/components/Navbar.jsx
+++ b/frontend/src/components/Navbar.jsx
@@ -148,7 +148,7 @@ function Navbar() {
>
)}
-
+
@@ -200,7 +200,7 @@ function Navbar() {
>
)}
-
+
diff --git a/frontend/src/message.jsx b/frontend/src/message.jsx
index 4741bc7..be520da 100644
--- a/frontend/src/message.jsx
+++ b/frontend/src/message.jsx
@@ -1,7 +1,29 @@
+import { useState } from 'react';
+import ChatList from './components/ChatList';
+import ChatBox from './components/ChatBox';
+
const Message = () => {
+ const [activeChat, setActiveChat] = useState(null);
+
+ const contacts = [
+ { id: 1, name: 'John Doe', message: 'Hey! How are you?' },
+ { id: 2, name: 'Jane Smith', message: 'Let’s catch up soon!' },
+ { id: 3, name: 'Mark Taylor', message: 'Check this out.' },
+ ];
+
+ const handleChatSelect = (contact) => {
+ setActiveChat(contact);
+ };
+
return (
- Message
- )
-}
+
+ {/* Chat List */}
+
+
+ {/* Chat Box */}
+
+
+ );
+};
export default Message;
\ No newline at end of file