import type { ListItemButtonProps } from '@mui/material' import { ListItemButton } from '@mui/material' import type { MouseEvent } from 'react' import React from 'react' import type { NavigateOptions, To } from 'react-router-dom' import { useNavigate } from 'react-router-dom' export interface ListItemButtonExProps extends ListItemButtonProps { target?: string to?: To toOptions?: NavigateOptions } export const ListItemButtonExTo: React.FC = ({ to, toOptions, onClick, ...props }) => { const navigate = useNavigate() const localOnClick = (event: MouseEvent) => { onClick?.(event) if (to) { void navigate(to, toOptions) } } return } export const ListItemButtonEx: React.FC = ({ to, ...props }) => { return to ? : }