mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-09 20:50:58 +00:00
feat(web): dynamic document title per route
The browser tab title was hard-coded to 'LangBot' in index.html and never changed. Add a useDocumentTitle hook that maps the active route to an existing i18n key and sets document.title to '<page> · LangBot', driven by a new top-level RootLayout route element. Re-runs on navigation and on language change so the title stays localized. Falls back to the bare app name for unmapped routes.
This commit is contained in:
@@ -25,11 +25,13 @@ import SkillsPage from '@/app/home/skills/page';
|
||||
import ErrorPage from '@/components/ErrorPage';
|
||||
import BackendUnavailablePage from '@/components/BackendUnavailablePage';
|
||||
import PluginPagesPage from '@/app/home/plugin-pages/page';
|
||||
import RootLayout from '@/app/RootLayout';
|
||||
|
||||
const Loading = () => <div>Loading...</div>;
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
element: <RootLayout />,
|
||||
errorElement: <ErrorPage />,
|
||||
children: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user