mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-25 23:24:03 +00:00
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>
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { Maximize2, Minimize2 } from 'lucide-react'
|
|
|
|
import CodeEditor from 'components/ui/CodeEditor/CodeEditor'
|
|
import { Button, FormControl_Shadcn_, Tooltip, TooltipContent, TooltipTrigger, cn } from 'ui'
|
|
|
|
export const FunctionEditor = ({
|
|
field,
|
|
language,
|
|
focused,
|
|
setFocused,
|
|
}: {
|
|
field: any
|
|
language: string
|
|
focused: boolean
|
|
setFocused: (b: boolean) => void
|
|
}) => {
|
|
return (
|
|
<div className={cn('rounded-md relative group flex-grow')}>
|
|
<FormControl_Shadcn_>
|
|
{language !== undefined && (
|
|
<CodeEditor
|
|
id="database-functions-editor"
|
|
language="pgsql"
|
|
placeholder={language === 'plpgsql' ? `BEGIN\n\nEND;` : undefined}
|
|
value={field.value}
|
|
onInputChange={field.onChange}
|
|
/>
|
|
)}
|
|
</FormControl_Shadcn_>
|
|
<div
|
|
className={cn(
|
|
'absolute top-0 right-2 bg-surface-300 border border-strong rounded h-[28px]',
|
|
'opacity-0 group-hover:opacity-100 group-hover:top-2 transition-all'
|
|
)}
|
|
>
|
|
<Tooltip>
|
|
<TooltipTrigger asChild>
|
|
<Button
|
|
type="text"
|
|
size="tiny"
|
|
className={cn(
|
|
'px-1.5 text-foreground-lighter hover:text-foreground',
|
|
'transition z-50'
|
|
)}
|
|
onClick={() => setFocused(!focused)}
|
|
icon={focused ? <Minimize2 /> : <Maximize2 />}
|
|
/>
|
|
</TooltipTrigger>
|
|
<TooltipContent side="bottom">
|
|
{focused ? 'Minimize editor' : 'Maximize editor'}
|
|
</TooltipContent>
|
|
</Tooltip>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|