mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 18:05:11 +03:00
* Add support for configuring realtime settings * Refactor * Fix TS * Fix TS * Smol update * Hide new UI for local selfhosted * Add feature flag * Fix reset logic * Fix * minor refactor * Fix package.json * Simplify
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import type { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
|
|
import type { Project } from 'data/projects/project-detail-query'
|
|
import { IS_PLATFORM } from 'lib/constants'
|
|
|
|
export const generateRealtimeMenu = (
|
|
project: Project,
|
|
flags?: { enableRealtimeSettings: boolean }
|
|
): ProductMenuGroup[] => {
|
|
const ref = project?.ref ?? 'default'
|
|
const { enableRealtimeSettings } = flags || {}
|
|
|
|
return [
|
|
{
|
|
title: 'Tools',
|
|
items: [
|
|
{
|
|
name: 'Inspector',
|
|
key: 'inspector',
|
|
url: `/project/${ref}/realtime/inspector`,
|
|
items: [],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
title: 'Configuration',
|
|
items: [
|
|
{
|
|
name: 'Policies',
|
|
key: 'policies',
|
|
url: `/project/${ref}/realtime/policies`,
|
|
items: [],
|
|
},
|
|
...(IS_PLATFORM && enableRealtimeSettings
|
|
? [
|
|
{
|
|
name: 'Settings',
|
|
key: 'settings',
|
|
url: `/project/${ref}/realtime/settings`,
|
|
items: [],
|
|
},
|
|
]
|
|
: []),
|
|
],
|
|
},
|
|
]
|
|
}
|