({ children }: BrandedLayoutProps)
| 8 | } |
| 9 | |
| 10 | export function BrandedLayout({ children }: BrandedLayoutProps) { |
| 11 | useEffect(() => { |
| 12 | const config = getBrandConfig() |
| 13 | |
| 14 | // Update document title |
| 15 | if (config.name !== 'Sim') { |
| 16 | document.title = config.name |
| 17 | } |
| 18 | |
| 19 | // Update favicon |
| 20 | if (config.faviconUrl) { |
| 21 | const faviconLink = document.querySelector("link[rel*='icon']") as HTMLLinkElement |
| 22 | if (faviconLink) { |
| 23 | faviconLink.href = config.faviconUrl |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | // Load custom CSS if provided |
| 28 | if (config.customCssUrl) { |
| 29 | const customCssId = 'custom-brand-css' |
| 30 | let customCssLink = document.getElementById(customCssId) as HTMLLinkElement |
| 31 | |
| 32 | if (!customCssLink) { |
| 33 | customCssLink = document.createElement('link') |
| 34 | customCssLink.id = customCssId |
| 35 | customCssLink.rel = 'stylesheet' |
| 36 | customCssLink.href = config.customCssUrl |
| 37 | document.head.appendChild(customCssLink) |
| 38 | } |
| 39 | } |
| 40 | }, []) |
| 41 | |
| 42 | return <>{children}</> |
| 43 | } |
nothing calls this directly
no test coverage detected