mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-09 11:51:55 +08:00
14 lines
465 B
TypeScript
14 lines
465 B
TypeScript
'use client'
|
|
import { useLayoutEffect } from 'react'
|
|
import { useGlobalPublicStore } from '@/context/global-public-context'
|
|
|
|
export default function useDocumentTitle(title: string) {
|
|
const { systemFeatures } = useGlobalPublicStore()
|
|
useLayoutEffect(() => {
|
|
if (systemFeatures.branding.enabled)
|
|
document.title = `${title} - ${systemFeatures.branding.application_title}`
|
|
else
|
|
document.title = `${title} - Dify`
|
|
}, [systemFeatures, title])
|
|
}
|