Proyectos de Subversion LeadersLinked - SPA

Rev

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

Rev 3619 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
  ListItem as MuiListItem,
5
  ListItem as MuiListItem,
6
  ListItemAvatar,
6
  ListItemAvatar,
7
  ListItemButton,
7
  ListItemButton,
8
  ListItemSecondaryAction,
8
  ListItemSecondaryAction,
9
  ListItemText
9
  ListItemText
10
} from '@mui/material';
10
} from '@mui/material';
11
 
11
 
12
export const ListItem = ({ image, title, subtitle, url, onClick, renderAction }) => {
12
export const ListItem = ({ image, title, subtitle, url, onClick, renderAction }) => {
13
  return (
13
  return (
14
    <MuiListItem disablePadding disableRipple>
14
    <MuiListItem disablePadding disableRipple>
15
      <ListItemButton
15
      <ListItemButton
16
        disableRipple
16
        disableRipple
17
        onClick={onClick}
17
        onClick={onClick}
18
        LinkComponent={url ? Link : undefined}
18
        LinkComponent={url ? Link : undefined}
19
        to={url || undefined}
19
        to={url || undefined}
20
      >
20
      >
21
        <ListItemAvatar>
21
        <ListItemAvatar>
22
          <Avatar alt={`${title} image`} src={image} />
22
          <Avatar alt={`${title} image`} src={image} />
23
        </ListItemAvatar>
23
        </ListItemAvatar>
24
 
24
 
25
        <ListItemText primary={title} secondary={subtitle} />
25
        <ListItemText primary={title} secondary={subtitle} />
26
 
26
 
27
        <ListItemSecondaryAction>{renderAction && renderAction()}</ListItemSecondaryAction>
27
        <ListItemSecondaryAction>{renderAction && renderAction()}</ListItemSecondaryAction>
28
      </ListItemButton>
28
      </ListItemButton>
29
    </MuiListItem>
29
    </MuiListItem>
30
  );
30
  );
31
};
31
};