import { Icon, Input, InputGroup, Kbd, Menu, Separator, Stack, Text } from '@chakra-ui/react'; import { createRootRouteWithContext, Outlet, Link } from '@tanstack/react-router'; import React from 'react'; import { Avatar } from '../components/ui/avatar'; import { Button } from '../components/ui/button'; import { ColorModeButton } from '../components/ui/color-mode'; import { Tooltip } from '../components/ui/tooltip'; import { useAuth } from '../hooks/auth'; import { useIdentity } from '../hooks/identity'; import { appName } from '../main'; const TanStackRouterDevtools = process.env.NODE_ENV === 'production' ? () => null // Render nothing in production : React.lazy(() => // Lazy load in development import('@tanstack/router-devtools').then(res => ({ default: res.TanStackRouterDevtools // For Embedded Mode // default: res.TanStackRouterDevtoolsPanel })) ); interface RouterContext { isAuthenticated: boolean; } export const Route = createRootRouteWithContext()({ component: () => { const { logout } = useAuth(); const identity = useIdentity(); return ( {appName} {/* */} {/* */} {/* */} {/* */} {/* */} {/* */} {/* */} {identity != null && ( <> editor create )} } endElement={⌘K} > {identity != null ? ( My profile logout()}> Log out ) : ( <> )} ); } });