Files
suwayomi-material-you-webui/src/features/core/components/menu/MenuItem.tsx
T

28 lines
974 B
TypeScript
Raw Normal View History

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-04-14 15:50:12 +02:00
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import MuiMenuItem, { MenuItemProps } from '@mui/material/MenuItem';
2023-12-30 04:04:59 +01:00
import { OverridableComponent } from '@mui/material/OverridableComponent';
2024-04-14 15:50:12 +02:00
import { SvgIconTypeMap } from '@mui/material/SvgIcon';
2023-12-30 04:04:59 +01:00
interface IProps extends MenuItemProps {
2023-12-30 04:04:59 +01:00
title: string;
Icon: OverridableComponent<SvgIconTypeMap> & { muiName: string };
}
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>
);