( command: CommandPaletteContextCommandInput, actionId: string, )
| 14 | const queryOverrideRegistry = new Map<string, (query: string) => CommandPaletteCommand[] | null>() |
| 15 | |
| 16 | function stripContextCommandAction( |
| 17 | command: CommandPaletteContextCommandInput, |
| 18 | actionId: string, |
| 19 | ): CommandPaletteContextCommand { |
| 20 | if ('action' in command) { |
| 21 | const { action: _action, ...commandWithoutAction } = command |
| 22 | return { |
| 23 | ...commandWithoutAction, |
| 24 | actionId, |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | return { |
| 29 | ...command, |
| 30 | actionId, |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | export function useCommandPalette() { |
| 35 | const isOpen = useState('command-palette:is-open', () => false) |
no outgoing calls
no test coverage detected