Files
sim/apps/sim/components/branded-layout.tsx
Waleed 552dc56fc3 feat(confluence): added more confluence endpoints (#3139)
* feat(confluence): added more confluence endpoints

* update license

* updated

* updated docs
2026-02-04 19:46:28 -08:00

44 lines
1.1 KiB
TypeScript

'use client'
import { useEffect } from 'react'
import { getBrandConfig } from '@/ee/whitelabeling'
interface BrandedLayoutProps {
children: React.ReactNode
}
export function BrandedLayout({ children }: BrandedLayoutProps) {
useEffect(() => {
const config = getBrandConfig()
// Update document title
if (config.name !== 'Sim') {
document.title = config.name
}
// Update favicon
if (config.faviconUrl) {
const faviconLink = document.querySelector("link[rel*='icon']") as HTMLLinkElement
if (faviconLink) {
faviconLink.href = config.faviconUrl
}
}
// Load custom CSS if provided
if (config.customCssUrl) {
const customCssId = 'custom-brand-css'
let customCssLink = document.getElementById(customCssId) as HTMLLinkElement
if (!customCssLink) {
customCssLink = document.createElement('link')
customCssLink.id = customCssId
customCssLink.rel = 'stylesheet'
customCssLink.href = config.customCssUrl
document.head.appendChild(customCssLink)
}
}
}, [])
return <>{children}</>
}