wip introduce shortcut to open chat

This commit is contained in:
lebaudantoine
2025-06-02 18:34:22 +02:00
parent 61aa3c79c5
commit 7b61defe3c
@@ -6,6 +6,7 @@ import { ToggleButton } from '@/primitives'
import { chatStore } from '@/stores/chat'
import { useSidePanel } from '../../hooks/useSidePanel'
import { ToggleButtonProps } from '@/primitives/ToggleButton'
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
export const ChatToggle = ({
onPress,
@@ -18,6 +19,12 @@ export const ChatToggle = ({
const { isChatOpen, toggleChat } = useSidePanel()
const tooltipLabel = isChatOpen ? 'open' : 'closed'
const shortcut = {
key: 'c',
ctrlKey: true,
}
useRegisterKeyboardShortcut({ shortcut, handler: toggleChat })
return (
<div
className={css({