'use client';
import { useEffect } from 'react';
export function useKeyboardShortcuts(shortcuts) {
    useEffect(() => {
        function handleKeyDown(e) {
            const meta = e.metaKey || e.ctrlKey;
            const parts = [];
            if (meta)
                parts.push('mod');
            if (e.shiftKey)
                parts.push('shift');
            if (e.altKey)
                parts.push('alt');
            parts.push(e.key.toLowerCase());
            const combo = parts.join('+');
            const handler = shortcuts[combo];
            if (handler) {
                e.preventDefault();
                handler(e);
            }
        }
        document.addEventListener('keydown', handleKeyDown);
        return () => document.removeEventListener('keydown', handleKeyDown);
    }, [shortcuts]);
}
//# sourceMappingURL=useKeyboardShortcuts.js.map