mirror of
https://github.com/supabase/supabase.git
synced 2026-05-09 02:09:50 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
44 lines
1.1 KiB
TypeScript
44 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 | undefined): ProductMenuGroup[] => {
|
|
const ref = project?.ref ?? 'default'
|
|
const showRealtimeSettings = IS_PLATFORM
|
|
|
|
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: [],
|
|
},
|
|
...(showRealtimeSettings
|
|
? [
|
|
{
|
|
name: 'Settings',
|
|
key: 'settings',
|
|
url: `/project/${ref}/realtime/settings`,
|
|
items: [],
|
|
},
|
|
]
|
|
: []),
|
|
],
|
|
},
|
|
]
|
|
}
|