import classNames from "classnames" ; import * as React from "react" ; import { Classes } from "../../common" ; import { HotkeyConfig } from "../../hooks" ; import { Dialog , DialogProps } from "../dialog/dialog" ; import { Hotkey } from "./hotkey" ; import { Hotkeys } from "./hotkeys" ; export interface HotkeysDialog2Props extends DialogProps { /**
     * This string displayed as the group name in the hotkeys dialog for all
     * global hotkeys.
     */ globalGroupName ? : string ; hotkeys : HotkeyConfig [ ] ; } export const HotkeysDialog2 = ( { globalGroupName = "Global" , hotkeys , ... props } ) => { return ( < Dialog { ... props } className = { classNames ( Classes . HOTKEY_DIALOG , props . className ) } > < div className = { Classes . DIALOG_BODY } > < Hotkeys > { hotkeys . map ( ( hotkey , index ) => ( < Hotkey key = { index } { ... hotkey } group = { hotkey . global === true && hotkey . group == null ? globalGroupName : hotkey . group } / > ) ) } < /Hotkeys> < /div> < /Dialog>); } ;