Add shortcut description to right click + add Suppr shortcut + Fix next selection after deletion

This commit is contained in:
Eric NGUYEN 2022-10-04 16:51:24 +02:00
parent 4e3c5d71fd
commit d580890b9d
6 changed files with 87 additions and 9 deletions

View file

@ -4,15 +4,18 @@ interface IMenuItemProps {
className?: string
text: string
title?: string
shortcut?: string
onClick: () => void
}
export function MenuItem(props: IMenuItemProps): JSX.Element {
return (
<button type="button"
className={props.className}
className={`flex place-content-between ${props.className ?? ''}`}
title={props.title}
onClick={() => props.onClick()}>{props.text}
onClick={() => props.onClick()}>
{props.text}
<span dangerouslySetInnerHTML={{ __html: props.shortcut ?? '' }} />
</button>
);
}