mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-08-29 13:16:58 +02:00
24 lines
531 B
TypeScript
24 lines
531 B
TypeScript
import { useDevice } from "../App";
|
|
|
|
const MenuItemContent = ({
|
|
icon,
|
|
shortcut,
|
|
children,
|
|
}: {
|
|
icon?: JSX.Element;
|
|
shortcut?: string;
|
|
children: React.ReactNode;
|
|
}) => {
|
|
const device = useDevice();
|
|
return (
|
|
<>
|
|
<div className="dropdown-menu-item__icon">{icon}</div>
|
|
<div className="dropdown-menu-item__text">{children}</div>
|
|
{shortcut && !device.editor.isMobile && (
|
|
<div className="dropdown-menu-item__shortcut">{shortcut}</div>
|
|
)}
|
|
</>
|
|
);
|
|
};
|
|
export default MenuItemContent;
|