mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 11:49:19 +00:00
75 lines
1.7 KiB
JavaScript
75 lines
1.7 KiB
JavaScript
import React from "react";
|
|
import { useParams } from "react-router-dom";
|
|
import Grid from "@material-ui/core/Grid";
|
|
import Paper from "@material-ui/core/Paper";
|
|
import { makeStyles } from "@material-ui/core/styles";
|
|
|
|
import TicketsList from "../../components/TicketsList/";
|
|
import MessagesList from "../../components/MessagesList/";
|
|
|
|
const useStyles = makeStyles(theme => ({
|
|
chatContainer: {
|
|
flex: 1,
|
|
// backgroundColor: "#eee",
|
|
padding: theme.spacing(4),
|
|
height: `calc(100% - 48px)`,
|
|
overflowY: "hidden",
|
|
},
|
|
|
|
chatPapper: {
|
|
// backgroundColor: "#eee",
|
|
display: "flex",
|
|
height: "100%",
|
|
},
|
|
|
|
contactsWrapper: {
|
|
display: "flex",
|
|
height: "100%",
|
|
flexDirection: "column",
|
|
overflowY: "hidden",
|
|
},
|
|
messagessWrapper: {
|
|
display: "flex",
|
|
height: "100%",
|
|
flexDirection: "column",
|
|
},
|
|
welcomeMsg: {
|
|
backgroundColor: "#eee",
|
|
display: "flex",
|
|
justifyContent: "space-evenly",
|
|
alignItems: "center",
|
|
height: "100%",
|
|
textAlign: "center",
|
|
},
|
|
}));
|
|
|
|
const Chat = () => {
|
|
const classes = useStyles();
|
|
const { ticketId } = useParams();
|
|
|
|
return (
|
|
<div className={classes.chatContainer}>
|
|
<Paper square className={classes.chatPapper}>
|
|
<Grid container spacing={0}>
|
|
<Grid item xs={4} className={classes.contactsWrapper}>
|
|
<TicketsList />
|
|
</Grid>
|
|
<Grid item xs={8} className={classes.messagessWrapper}>
|
|
{ticketId ? (
|
|
<>
|
|
<MessagesList />
|
|
</>
|
|
) : (
|
|
<Paper square variant="outlined" className={classes.welcomeMsg}>
|
|
<span>Selecione um contato para começar a conversar</span>
|
|
</Paper>
|
|
)}
|
|
</Grid>
|
|
</Grid>
|
|
</Paper>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Chat;
|