@mantine/spotlight
Version:
Command center components for react and Mantine
1 lines • 814 B
Source Map (JSON)
{"version":3,"file":"get-hotkeys.cjs","names":["spotlightActions"],"sources":["../src/get-hotkeys.ts"],"sourcesContent":["import { HotkeyItem } from '@mantine/hooks';\nimport { spotlightActions, SpotlightStore } from './spotlight.store';\n\nexport function getHotkeys(\n hotkeys: string | string[] | null | undefined,\n store: SpotlightStore\n): HotkeyItem[] {\n if (!hotkeys) {\n return [];\n }\n\n const open = () => spotlightActions.open(store);\n\n if (Array.isArray(hotkeys)) {\n return hotkeys.map((hotkey) => [hotkey, open]);\n }\n\n return [[hotkeys, open]];\n}\n"],"mappings":";;;AAGA,SAAgB,WACd,SACA,OACc;CACd,IAAI,CAAC,SACH,OAAO,CAAC;CAGV,MAAM,aAAaA,wBAAAA,iBAAiB,KAAK,KAAK;CAE9C,IAAI,MAAM,QAAQ,OAAO,GACvB,OAAO,QAAQ,KAAK,WAAW,CAAC,QAAQ,IAAI,CAAC;CAG/C,OAAO,CAAC,CAAC,SAAS,IAAI,CAAC;AACzB"}