Proyectos de Subversion LeadersLinked - SPA

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3577 stevensc 1
import React from 'react';
2
import { useNavigate } from 'react-router-dom';
3
import {
4
  Avatar,
5
  // Checkbox,
6
  List,
7
  ListItem,
8
  ListItemButton,
9
  // ListItemIcon,
10
  ListItemText,
11
  Typography
12
} from '@mui/material';
13
 
14
import Widget from '../../../components/UI/Widget';
15
 
16
export default function EmailList({ emails = [] }) {
17
  const navigate = useNavigate();
18
 
19
  return (
20
    <Widget>
21
      <List>
22
        {emails.map(({ email_id, name, subject, date, image }, index) => (
23
          <ListItem
24
            key={email_id}
25
            disablePadding
26
            sx={{
27
              borderBottom: `${index + 1 === emails.length ? 0 : '1px'} solid var(--border-primary)`
28
            }}
29
          >
30
            <ListItemButton onClick={() => navigate(email_id)} dense>
31
              {/* <ListItemIcon>
32
                <Checkbox
33
                  edge='start'
34
                  checked={checked === uuid}
35
                  tabIndex={-1}
36
                  disableRipple
37
                  inputProps={{ 'aria-labelledby': uuid }}
38
                />
39
              </ListItemIcon> */}
40
              <Avatar src={image} alt={name} sx={{ marginRight: 0.5 }} />
41
              <ListItemText id={email_id} primary={name + ' - ' + subject} />
42
              <Typography variant='overline'>{date}</Typography>
43
            </ListItemButton>
44
          </ListItem>
45
        ))}
46
      </List>
47
    </Widget>
48
  );
49
}