| 6340 |
stevensc |
1 |
import React, { useState } from 'react'
|
|
|
2 |
|
|
|
3 |
// Components
|
|
|
4 |
import Chat from '../components/chat/Chat'
|
|
|
5 |
import EmptySection from '../../shared/empty-section/EmptySection'
|
|
|
6 |
import Contacts from '../components/contacts/Contacts'
|
|
|
7 |
|
|
|
8 |
const DesktopChat = ({ chatUsers = [], chatGroups = [], timezones = {} }) => {
|
|
|
9 |
const [selectedConversation, setSelectedConversation] = useState(null)
|
|
|
10 |
|
|
|
11 |
return (
|
|
|
12 |
<>
|
|
|
13 |
<main className="chat-page container">
|
|
|
14 |
<Contacts
|
|
|
15 |
persons={chatUsers}
|
|
|
16 |
groups={chatGroups}
|
|
|
17 |
selectedConversation={selectedConversation}
|
|
|
18 |
changeConversation={(conversation) =>
|
|
|
19 |
setSelectedConversation(conversation)
|
|
|
20 |
}
|
|
|
21 |
/>
|
|
|
22 |
{selectedConversation ? (
|
|
|
23 |
<Chat entity={selectedConversation} timezones={timezones} />
|
|
|
24 |
) : (
|
|
|
25 |
<EmptySection message="Seleccione un chat" />
|
|
|
26 |
)}
|
|
|
27 |
</main>
|
|
|
28 |
</>
|
|
|
29 |
)
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
export default DesktopChat
|