Initial commit: Meshkee dashboards monorepo.
Includes business, customer, and super-admin apps with shared packages and production deploy scripts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { useEffect } from 'react'
|
||||
import {
|
||||
formatDashboardDocumentTitle,
|
||||
resolveRoutePageLabels,
|
||||
type RouteTitleRule,
|
||||
} from '@meshkee/dashboard-core'
|
||||
|
||||
interface UseDashboardDocumentTitleOptions {
|
||||
businessName: string
|
||||
dashboardName: string
|
||||
pathname: string
|
||||
routeRules: RouteTitleRule[]
|
||||
pageLabels?: string[]
|
||||
}
|
||||
|
||||
export function useDashboardDocumentTitle({
|
||||
businessName,
|
||||
dashboardName,
|
||||
pathname,
|
||||
routeRules,
|
||||
pageLabels,
|
||||
}: UseDashboardDocumentTitleOptions) {
|
||||
useEffect(() => {
|
||||
const resolvedLabels = pageLabels ?? resolveRoutePageLabels(pathname, routeRules)
|
||||
document.title = formatDashboardDocumentTitle({
|
||||
businessName,
|
||||
dashboardName,
|
||||
pageLabels: resolvedLabels,
|
||||
})
|
||||
}, [businessName, dashboardName, pathname, routeRules, pageLabels])
|
||||
}
|
||||
Reference in New Issue
Block a user