设置 Web 页面标题

This commit is contained in:
xintaofei
2026-03-25 23:29:12 +08:00
parent c4bb0ed092
commit d17148f3ba
8 changed files with 62 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
"use client"
import { useCallback, type ComponentType, type ReactNode } from "react"
import { useCallback, useEffect, type ComponentType, type ReactNode } from "react"
import {
Bot,
BookOpenText,
@@ -99,6 +99,10 @@ export function SettingsShell({ children }: SettingsShellProps) {
const router = useRouter()
const normalizedPathname = normalizePath(pathname)
useEffect(() => {
document.title = `${t("title")} - codeg`
}, [t])
const navigateTo = useCallback(
(href: string) => {
if (typeof window === "undefined") return