Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2947 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

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