Add rename/delete/send to cmd+k

This commit is contained in:
Gregory Schier
2024-07-30 15:10:24 -07:00
parent a75b1a3472
commit 86856e3506
6 changed files with 103 additions and 45 deletions

View File

@@ -0,0 +1,21 @@
import { useCallback } from 'react';
import { CommandPalette } from '../components/CommandPalette';
import { useDialog } from '../components/DialogContext';
export function useToggleCommandPalette() {
const dialog = useDialog();
const togglePalette = useCallback(() => {
dialog.toggle({
id: 'command_palette',
size: 'dynamic',
hideX: true,
className: '!max-h-[min(30rem,calc(100vh-4rem))]',
vAlign: 'top',
noPadding: true,
noScroll: true,
render: ({ hide }) => <CommandPalette onClose={hide} />,
});
}, [dialog]);
return togglePalette;
}