mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-19 02:34:37 -05:00
* feat(confluence): added more confluence endpoints * update license * updated * updated docs
44 lines
1.1 KiB
TypeScript
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}</>
|
|
}
|