ruvector/studio/components/layouts/AppLayout/InlineEditorButton.tsx
rUv 814f595995 feat(studio): Add complete RuVector Studio application
Major additions:
- Complete Next.js studio application with 1600+ components
- Docker support (Dockerfile.combined, docker-compose.yml)
- GCP deployment documentation and benchmarks
- SQL benchmark scripts for performance testing
- Sentry integration for monitoring
- Comprehensive test suite and mocks

Studio features:
- Dashboard and admin interfaces
- Data visualization components
- Authentication and user management
- API integration with RuVector backend
- Static data and public assets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-06 23:04:48 +00:00

51 lines
1.6 KiB
TypeScript

import { LOCAL_STORAGE_KEYS } from 'common'
import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import { useLocalStorageQuery } from 'hooks/misc/useLocalStorage'
import { SqlEditor } from 'icons'
import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'
import { cn, KeyboardShortcut } from 'ui'
const InlineEditorKeyboardTooltip = () => {
const [hotkeyEnabled] = useLocalStorageQuery(
LOCAL_STORAGE_KEYS.HOTKEY_SIDEBAR(SIDEBAR_KEYS.EDITOR_PANEL),
true
)
return hotkeyEnabled ? <KeyboardShortcut keys={['Meta', 'E']} /> : null
}
export const InlineEditorButton = () => {
const { activeSidebar, toggleSidebar } = useSidebarManagerSnapshot()
const isOpen = activeSidebar?.id === SIDEBAR_KEYS.EDITOR_PANEL
const handleClick = () => {
toggleSidebar(SIDEBAR_KEYS.EDITOR_PANEL)
}
return (
<ButtonTooltip
type="outline"
size="tiny"
id="editor-trigger"
className={cn(
'rounded-full w-[32px] h-[32px] flex items-center justify-center p-0 text-foreground-light hover:text-foreground',
isOpen && 'bg-foreground text-background hover:text-background'
)}
onClick={handleClick}
tooltip={{
content: {
className: 'p-1 pl-2.5',
text: (
<div className="flex items-center gap-2.5">
<span>SQL Editor</span>
<InlineEditorKeyboardTooltip />
</div>
),
},
}}
>
<SqlEditor size={18} strokeWidth={1.5} />
</ButtonTooltip>
)
}