2022-08-20 22:23:43 -05:00
|
|
|
import Typography from '@mui/material/Typography'
|
|
|
|
|
|
|
|
import { UnsentMessage, ReceivedMessage } from 'models/chat'
|
|
|
|
|
|
|
|
export interface ChatTranscriptProps {
|
|
|
|
messageLog: Array<UnsentMessage | ReceivedMessage>
|
|
|
|
}
|
|
|
|
|
|
|
|
export const ChatTranscript = ({ messageLog }: ChatTranscriptProps) => {
|
|
|
|
return (
|
2022-08-21 10:32:54 -05:00
|
|
|
<div className="ChatTranscript flex flex-col">
|
2022-08-20 22:23:43 -05:00
|
|
|
{messageLog.map((message, idx) => (
|
2022-08-21 10:32:54 -05:00
|
|
|
<div className="block">
|
|
|
|
<Typography
|
|
|
|
key={`${idx}_${message}`}
|
|
|
|
variant="body1"
|
|
|
|
sx={{
|
|
|
|
backgroundColor: 'primary.dark',
|
|
|
|
margin: 0.5,
|
|
|
|
padding: 1,
|
|
|
|
borderRadius: 4,
|
|
|
|
float: 'left',
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{message.text}
|
|
|
|
</Typography>
|
|
|
|
</div>
|
2022-08-20 22:23:43 -05:00
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|