2023-12-30 04:04:59 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
2024-01-29 20:54:56 +01:00
|
|
|
import { ListItemIcon, ListItemText, MenuItem as MuiMenuItem, MenuItemProps } from '@mui/material';
|
2023-12-30 04:04:59 +01:00
|
|
|
import { OverridableComponent } from '@mui/material/OverridableComponent';
|
|
|
|
|
import { SvgIconTypeMap } from '@mui/material/SvgIcon/SvgIcon';
|
|
|
|
|
|
2024-01-29 20:54:56 +01:00
|
|
|
interface IProps extends MenuItemProps {
|
2023-12-30 04:04:59 +01:00
|
|
|
title: string;
|
|
|
|
|
Icon: OverridableComponent<SvgIconTypeMap> & { muiName: string };
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-29 20:54:56 +01:00
|
|
|
export const MenuItem = ({ title, Icon, ...menuItemProps }: IProps) => (
|
|
|
|
|
<MuiMenuItem {...menuItemProps}>
|
2023-12-30 04:04:59 +01:00
|
|
|
<ListItemIcon>
|
|
|
|
|
<Icon fontSize="small" />
|
|
|
|
|
</ListItemIcon>
|
|
|
|
|
<ListItemText>{title}</ListItemText>
|
|
|
|
|
</MuiMenuItem>
|
|
|
|
|
);
|