import { Button, Stack } from '@chakra-ui/react'; import { createRootRoute, Link, Outlet } from '@tanstack/react-router'; import React from 'react'; import { useAuth } from '../hooks/auth'; 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 })) ); export const Route = createRootRoute({ component: () => { const { isAuthenticated, logout } = useAuth(); return ( {!isAuthenticated ? ( <> ) : ( )}
); } });