Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 6956 | Rev 7260 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6911 stevensc 1
import React, { useState } from 'react'
2
import { useSelector } from 'react-redux'
3
import { Col, Container, Row } from 'react-bootstrap'
4
import QuestionAnswerRoundedIcon from '@mui/icons-material/QuestionAnswerRounded'
5
 
6
import ChatBox from '../../components/chat/ChatBox'
6956 stevensc 7
import Contacts from '../../components/chat/ChatContacts'
6911 stevensc 8
import EmptySection from '../../components/UI/EmptySection'
9
 
10
const ChatPage = () => {
11
  const [selectedConversation, setSelectedConversation] = useState(null)
12
  const labels = useSelector(({ intl }) => intl.labels)
13
 
14
  const changeConversation = (conversation) => {
15
    setSelectedConversation(conversation)
16
  }
17
 
18
  return (
19
    <Container>
20
      <Row>
6915 stevensc 21
        <Col md="4">
6911 stevensc 22
          <Contacts
23
            selectedConversation={selectedConversation}
24
            changeConversation={changeConversation}
25
          />
26
        </Col>
6920 stevensc 27
        <Col md="8" className="d-flex">
6911 stevensc 28
          {selectedConversation ? (
7259 stevensc 29
            <ChatBox
30
              entity={selectedConversation}
31
              changeConversation={changeConversation}
32
            />
6911 stevensc 33
          ) : (
34
            <EmptySection
35
              message={labels.select_conversation}
36
              Icon={<QuestionAnswerRoundedIcon />}
6920 stevensc 37
              align="center"
6911 stevensc 38
            />
39
          )}
40
        </Col>
41
      </Row>
42
    </Container>
43
  )
44
}
45
 
46
export default ChatPage