Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React from 'react';import { Link } from 'react-router-dom';import {Avatar,ListItem as MuiListItem,ListItemAvatar,ListItemButton,ListItemSecondaryAction,ListItemText} from '@mui/material';export const ListItem = ({ image, title, subtitle, url, onClick, renderAction }) => {return (<MuiListItem disablePadding disableRipple><ListItemButtondisableRippleonClick={onClick}LinkComponent={url ? Link : undefined}to={url || undefined}><ListItemAvatar><Avatar alt={`${title} image`} src={image} /></ListItemAvatar><ListItemText primary={title} secondary={subtitle} /><ListItemSecondaryAction>{renderAction && renderAction()}</ListItemSecondaryAction></ListItemButton></MuiListItem>);};