import React from "react" import { useHotkeys } from "react-hotkeys-hook" type HotKeyActionProps = { label: string hotKey: string icon: React.ReactNode onAction: (keyboardEvent: KeyboardEvent, hotkeysEvent: any) => void | boolean } const HotKeyAction = ({ label, hotKey, icon, onAction }: HotKeyActionProps) => { useHotkeys(hotKey, onAction, {}) return (
{label}
{icon}
) } export default HotKeyAction