var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React from 'react';
import { ListItem, ListItemIcon, ListItemText, makeStyles } from '@material-ui/core';
import clsx from 'clsx';
import { Link } from 'react-router-dom';
// import { Link,  useResolvedPath } from 'react-router-dom';
const useStyles = makeStyles((theme) => {
    var _a, _b, _c, _d;
    return ({
        root: {
            backgroundColor: 'transparent',
            color: (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.contrastText,
            // ...theme.mixins.toolbar,
            '& .MuiListItemIcon-root': {
                color: 'inherit'
            }
        },
        active: {
            color: (_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.secondary) === null || _d === void 0 ? void 0 : _d.main
        }
    });
}, { name: 'SidebarListItem' });
/**
 * Styled list itme for sidebar navigation
 */
const SidebarListItem = (props) => {
    const classes = useStyles(props);
    const { icon, primary, to, href, onClick, className } = props, other = __rest(props
    // const path = useResolvedPath(to ?? '');
    // const match = useMatch({ path: path.pathname });
    , ["icon", "primary", "to", "href", "onClick", "className"])
    // const path = useResolvedPath(to ?? '');
    // const match = useMatch({ path: path.pathname });
    ;
    // const path = useResolvedPath(to ?? '');
    // const match = useMatch({ path: path.pathname });
    const match = null;
    const component = to ? Link : href ? 'a' : undefined;
    const button = !!(to || href || onClick);
    const active = !!(to && match);
    return (React.createElement(ListItem, Object.assign({ component: component, button: button, to: to, href: href, onClick: onClick, className: clsx(className, classes.root, { [classes.active]: active }) }, other), React.createElement(ListItemIcon, null, icon), React.createElement(ListItemText, { primary: primary })));
};
export default SidebarListItem;
//# sourceMappingURL=SidebarListItem.js.map