import { useLocation } from '@tanstack/react-router' import type { PropsWithChildren } from 'react' import { ProjectLayout } from '../ProjectLayout' import { generateRealtimeMenu } from './RealtimeMenu.utils' import { ProductMenu } from '@/components/ui/ProductMenu' import { ProductMenuShortcuts } from '@/components/ui/ProductMenu/ProductMenuShortcuts' import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' import { withAuth } from '@/hooks/misc/withAuth' /** * Menu-only component for the Realtime section. Used by the desktop sidebar and by the * mobile sheet submenu. Must not wrap ProjectLayout so that opening the realtime submenu * in the mobile sheet does not overwrite registerOpenMenu and break the menu button. */ export const RealtimeProductMenu = () => { const pathname = useLocation({ select: (location) => location.pathname }) const { data: project } = useSelectedProjectQuery() const page = pathname.split('/')[4] return } export interface RealtimeLayoutProps { title: string } export const RealtimeLayout = ({ title, children }: PropsWithChildren) => { const { data: project } = useSelectedProjectQuery() const pathname = useLocation({ select: (location) => location.pathname }) const page = pathname.split('/')[4] const menu = generateRealtimeMenu(project) return ( } isBlocking={false} > {children} ) } export default withAuth(RealtimeLayout)