Files
supabase/apps/studio/components/layouts/AppLayout/AssistantButton.tsx
T
Saxon FletcherandJoshen Lim a224598f1e Decouple editor panel (#37707)
* decouple editor panel from global state

* refactor again

* dont close assistant

* remove async

* onsave props

* Fix TS errors

* Remove editorPanel state from app-state, use useHotKey hooks for keyboard shortcuts

* Minor UX improvements to EditorPanel

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-08-06 15:03:53 +07:00

33 lines
905 B
TypeScript

import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import { AiIconAnimation } from 'ui'
import { KeyboardShortcut } from 'ui'
export const AssistantButton = () => {
const snap = useAiAssistantStateSnapshot()
return (
<ButtonTooltip
type="text"
size="tiny"
id="assistant-trigger"
className="rounded-none w-[32px] h-[30px] flex items-center justify-center p-0 hover:bg-brand-400"
onClick={() => {
snap.toggleAssistant()
}}
tooltip={{
content: {
text: (
<div className="flex items-center gap-4">
<span>AI Assistant</span>
<KeyboardShortcut keys={['Meta', 'i']} />
</div>
),
},
}}
>
<AiIconAnimation allowHoverEffect={false} size={16} />
</ButtonTooltip>
)
}