Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2947 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3719 stevensc 1
import React from 'react';
2
import { Link } from 'react-router-dom';
3
import {
4
  Avatar,
5
  ListItemAvatar,
6
  ListItemButton,
7
  ListItemText,
8
  List as MuiList
9
} from '@mui/material';
10
 
11
export function List({ children, styles, ...props }) {
12
  return (
13
    <MuiList sx={styles} {...props}>
14
      {children}
15
    </MuiList>
16
  );
17
}
18
 
19
export function ListItem({
20
  renderAction = () => null,
21
  title = '',
22
  subheader = '',
23
  avatarVariant = 'rounded',
24
  image = '',
25
  url = '',
26
  ...props
27
}) {
28
  return (
29
    <ListItemButton
30
      disableRipple
31
      secondaryAction={renderAction()}
32
      sx={{ gap: 1 }}
33
      LinkComponent={url && Link}
34
      to={url}
35
      {...props}
36
    >
37
      {image ? (
38
        <ListItemAvatar>
39
          <Avatar src={image} alt={title} variant={avatarVariant} />
40
        </ListItemAvatar>
41
      ) : null}
42
 
43
      <ListItemText primary={title} secondary={subheader} primaryTypographyProps={{}} />
44
    </ListItemButton>
45
  );
46
}
47
 
48
List.Item = ListItem;
49
 
50
export default List;