| 3580 |
stevensc |
1 |
import React from 'react';
|
|
|
2 |
import { Avatar, Box, Typography } from '@mui/material';
|
|
|
3 |
|
|
|
4 |
export const ConversationItem = ({ conversation, onSelectConversation }) => {
|
|
|
5 |
return (
|
|
|
6 |
<Box
|
|
|
7 |
sx={{ display: 'flex', alignItems: 'center', gap: 2 }}
|
|
|
8 |
onClick={() => onSelectConversation(conversation)}
|
|
|
9 |
>
|
|
|
10 |
<Avatar src={conversation.image} alt={conversation.name} />
|
|
|
11 |
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 1 }}>
|
|
|
12 |
<Typography variant='h6'>{conversation.name}</Typography>
|
|
|
13 |
<Typography variant='body2'>{conversation.last_message}</Typography>
|
|
|
14 |
</Box>
|
|
|
15 |
</Box>
|
|
|
16 |
);
|
|
|
17 |
};
|