svg-layout-designer-react/src/Components/Menu/MenuItem.tsx
2023-02-10 16:29:10 +01:00

21 lines
514 B
TypeScript

import * as React from 'react';
interface IMenuItemProps {
className?: string
text: string
title?: string
shortcut?: string
onClick: () => void
}
export function MenuItem(props: IMenuItemProps): JSX.Element {
return (
<button type="button"
className={`flex place-content-between ${props.className ?? ''}`}
title={props.title}
onClick={() => { props.onClick(); }}>
{props.text}
<span dangerouslySetInnerHTML={{ __html: props.shortcut ?? '' }} />
</button>
);
}