mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-05-25 15:03:46 +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>
46 lines
1.4 KiB
TypeScript
46 lines
1.4 KiB
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
|
|
import { get, handleError } from 'data/fetchers'
|
|
import { IS_PLATFORM } from 'lib/constants'
|
|
import type { ResponseError, UseCustomQueryOptions } from 'types'
|
|
import { subscriptionKeys } from './keys'
|
|
|
|
export type ProjectAddonsVariables = {
|
|
projectRef?: string
|
|
}
|
|
|
|
// [Joshen] For any customer facing text - let's use "Add-on" hyphenated
|
|
// Will need to address consistency across the dashboard
|
|
|
|
export async function getProjectAddons(
|
|
{ projectRef }: ProjectAddonsVariables,
|
|
signal?: AbortSignal
|
|
) {
|
|
if (!projectRef) throw new Error('projectRef is required')
|
|
|
|
const { error, data } = await get(`/platform/projects/{ref}/billing/addons`, {
|
|
params: { path: { ref: projectRef } },
|
|
signal,
|
|
})
|
|
|
|
if (error) handleError(error)
|
|
return data
|
|
}
|
|
|
|
export type ProjectAddonsData = Awaited<ReturnType<typeof getProjectAddons>>
|
|
export type ProjectAddonsError = ResponseError
|
|
|
|
export const useProjectAddonsQuery = <TData = ProjectAddonsData>(
|
|
{ projectRef }: ProjectAddonsVariables,
|
|
{
|
|
enabled = true,
|
|
...options
|
|
}: UseCustomQueryOptions<ProjectAddonsData, ProjectAddonsError, TData> = {}
|
|
) =>
|
|
useQuery<ProjectAddonsData, ProjectAddonsError, TData>({
|
|
queryKey: subscriptionKeys.addons(projectRef),
|
|
queryFn: ({ signal }) => getProjectAddons({ projectRef }, signal),
|
|
enabled: enabled && IS_PLATFORM && typeof projectRef !== 'undefined',
|
|
staleTime: 60 * 60 * 1000,
|
|
...options,
|
|
})
|