add navigation manager to streamline titles and breadcrumbs

This commit is contained in:
Elijah Duffy
2025-09-01 12:29:16 -07:00
parent 647b3401a7
commit 5a9574bec9
3 changed files with 252 additions and 0 deletions

View File

@@ -24,6 +24,17 @@ export const defaultIconProps: IconComponentProps = {
*/
export type MaybeGetter<T> = T | (() => T);
/**
* ResolveGetter returns the underlying value stored by a MaybeGetter type.
* @returns Raw value T or function return T.
*/
export const resolveGetter = <T>(getter: MaybeGetter<T>): T => {
if (typeof getter === 'function') {
return (getter as () => T)();
}
return getter;
};
/**
* Generates a unique identifier string unless an identifier is provided.
* If a prefix is provided, it will be prepended to the identifier.