refactor: support i18n
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
import { useEffect, useRef } from "react"
|
||||
import { usePathname } from "next/navigation"
|
||||
|
||||
import { LocaleSwitcher } from "@/components/locale-switcher"
|
||||
import { RealtimeConnectionStatus } from "@/components/realtime-connection-status"
|
||||
import { getPageTitle } from "@/lib/navigation"
|
||||
import { useI18n } from "@/i18n/provider"
|
||||
import { getPageTitleKey } from "@/lib/navigation"
|
||||
import { useAgentConversationsStore } from "@/lib/stores/agent-conversations"
|
||||
import { PaletteToggle } from "@/components/palette-toggle"
|
||||
import { ThemeToggle } from "@/components/theme-toggle"
|
||||
@@ -20,9 +22,10 @@ import { SidebarTrigger, useSidebar } from "@/components/ui/sidebar"
|
||||
const SIDEBAR_STORAGE_KEY = "dashboard_sidebar_open"
|
||||
|
||||
export function SiteHeader() {
|
||||
const t = useI18n()
|
||||
const pathname = usePathname()
|
||||
const { open, setOpen, isMobile } = useSidebar()
|
||||
const pageTitle = getPageTitle(pathname)
|
||||
const pageTitle = t(getPageTitleKey(pathname))
|
||||
const realtimeStatus = useAgentConversationsStore((state) => state.realtimeStatus)
|
||||
const hasRestoredRef = useRef(false)
|
||||
const showConversationRealtime =
|
||||
@@ -75,6 +78,7 @@ export function SiteHeader() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
<LocaleSwitcher />
|
||||
<PaletteToggle />
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user