initial commit
Some checks failed
ci / go (push) Has been cancelled
ci / admin-ui (push) Has been cancelled
ci / runtime-sdk (push) Has been cancelled
ci / helm (push) Has been cancelled
ci / openapi (push) Has been cancelled
ci / container (push) Has been cancelled
ci / release-config (push) Has been cancelled
ci / shared styling (push) Has been cancelled
ci / security (push) Has been cancelled
ci / all green (push) Has been cancelled

This commit is contained in:
Daniel Noulet 2026-10-07 15:11:35 +02:00
commit 951dd8d26b
175 changed files with 50041 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import { useContext } from 'react'
import { AdminThemeContextInstance, type AdminThemeValue } from './admin-theme-context'
/**
* Reads the admin theme context.
*
* Throws when used outside a provider rather than returning a default. A silent
* default would let a component render with the wrong theme and never report the
* mistake, which is exactly the class of bug this codebase's tooling exists to
* surface.
*/
export function useAdminTheme(): AdminThemeValue {
const value = useContext(AdminThemeContextInstance)
if (!value) {
throw new Error('useAdminTheme must be used inside an AdminThemeProvider')
}
return value
}