ruvector/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.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

39 lines
1.3 KiB
TypeScript

import { useParams } from 'common'
import { useEdgeFunctionsQuery } from 'data/edge-functions/edge-functions-query'
import { useAppStateSnapshot } from 'state/app-state'
import { DOCS_RESOURCE_CONTENT } from '../ProjectAPIDocs.constants'
import ResourceContent from '../ResourceContent'
import type { ContentProps } from './Content.types'
export const EdgeFunction = ({ language, apikey = 'API_KEY', endpoint }: ContentProps) => {
const { ref } = useParams()
const snap = useAppStateSnapshot()
const { data } = useEdgeFunctionsQuery({ projectRef: ref })
const resource = snap.activeDocsSection[1]
const edgeFunctions = data ?? []
const edgeFunction = edgeFunctions.find((fn) => fn.name === resource)
if (edgeFunction === undefined) return null
return (
<div className="divide-y">
<div className="space-y-1 px-4 py-4">
<div className="flex items-center space-x-2">
<h2>{edgeFunction.name}</h2>
</div>
</div>
<ResourceContent
selectedLanguage={language}
snippet={DOCS_RESOURCE_CONTENT.invokeEdgeFunction}
codeSnippets={DOCS_RESOURCE_CONTENT.invokeEdgeFunction.code({
name: resource,
endpoint: `${endpoint}`,
apikey: apikey,
})}
/>
</div>
)
}