From 50afb25704518edaafd33be153cd6a78fe0a30fd Mon Sep 17 00:00:00 2001 From: adriano Date: Wed, 26 Jan 2022 00:38:09 -0300 Subject: [PATCH] =?UTF-8?q?Altera=C3=A7=C3=A3o=20no=20modal=20do=20chat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Report/Modal/index.js | 91 +++++++------------ 1 file changed, 31 insertions(+), 60 deletions(-) diff --git a/frontend/src/components/Report/Modal/index.js b/frontend/src/components/Report/Modal/index.js index 205ccc7..0099389 100644 --- a/frontend/src/components/Report/Modal/index.js +++ b/frontend/src/components/Report/Modal/index.js @@ -6,75 +6,46 @@ import DialogActions from '@mui/material/DialogActions'; import DataGridTable from '../Table'; import MTable from "../MTable"; -//let columns = [{ title: 'Chat', field: 'messages.body' },]; - -// { title: 'Atendente', field: 'user.name' }, - -const columns = [ - { field: 'id', - title: 'ID', - width: 50, - sortable: false}, +let columns = [ { - field: 'fromMe', - title: 'user/client', - type: 'bool', - width: 100, - flex: 1, - editable: false, - sortable: false - }, - { - field: 'body', - title: 'message', - type: 'string', - //width: 150, - flex: 1, - editable: false, - sortable: false - + title: 'Atendente/Cliente', + field: 'fromMe', }, - /* { - field: 'mediaType', - headerName: 'media type', - //width: 110, - flex: 1, - editable: false, - }, { - field: 'mediaUrl', - headerName: 'media url', - type: 'string', - //width: 110, - flex: 1, - editable: false, - }, - { - field: 'read', - headerName: 'tead', - type: 'bool', - //width: 110, - flex: 1, - editable: false, - },*/ - { - field: 'createdAt', - title: 'created at', - type: 'dateTime', - //width: 110, - flex: 1, - editable: false, - sortable: false - } + title: 'Mensagem', + field: 'body', + cellStyle: {whiteSpace: 'nowrap'}, + }, + + { title: 'Criado', field: 'createdAt' } + + /*cellStyle: { + backgroundColor: '#039be5', + color: '#FFF' + }, + headerStyle: { + backgroundColor: '#039be5', + fontSize: 12 + }*/ + +] + -]; + const Modal = (props) => { const [open, setOpen] = React.useState(true); const [scroll, setScroll] = React.useState('paper'); - + const dataChat = props.data.map((dt) => { + return { + 'fromMe': dt.fromMe ? 'Atendente' : 'Cliente', + 'body': dt.body, + 'createdAt': dt.createdAt + } + }); + const handleClose = () => { setOpen(false); }; @@ -104,7 +75,7 @@ const Modal = (props) => { aria-describedby="scroll-dialog-description" > - +