* Create multiselect car table control Remove table overflow containers * Include trim to add car form * CEC-252 Replace modal status with link to car details page * Remove send command from car status page Fix menu key warning
34 lines
872 B
JavaScript
34 lines
872 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
import ListItem from "@material-ui/core/ListItem";
|
|
import ListItemIcon from "@material-ui/core/ListItemIcon";
|
|
import ListItemText from "@material-ui/core/ListItemText";
|
|
import { Link as RouterLink } from "react-router-dom";
|
|
|
|
function ListItemLink(props) {
|
|
const { icon, primary, to } = props;
|
|
|
|
const renderLink = React.useMemo(
|
|
() =>
|
|
React.forwardRef((itemProps, ref) => (
|
|
<RouterLink to={to} ref={ref} {...itemProps} />
|
|
)),
|
|
[to]
|
|
);
|
|
|
|
return (
|
|
<ListItem button component={renderLink}>
|
|
{icon ? <ListItemIcon>{icon}</ListItemIcon> : null}
|
|
<ListItemText primary={primary} />
|
|
</ListItem>
|
|
);
|
|
}
|
|
|
|
ListItemLink.propTypes = {
|
|
icon: PropTypes.element,
|
|
primary: PropTypes.string.isRequired,
|
|
to: PropTypes.string.isRequired,
|
|
};
|
|
|
|
export default ListItemLink;
|