mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-22 01:24:52 +02:00
11 lines
379 B
TypeScript
11 lines
379 B
TypeScript
import React, { createContext, useContext } from 'react';
|
|
|
|
/** True when Dashboard is the visible route; heavy children short-circuit when false. */
|
|
const DashboardActiveContext = createContext<boolean>(true);
|
|
|
|
export const DashboardActiveProvider = DashboardActiveContext.Provider;
|
|
|
|
export function useDashboardActive(): boolean {
|
|
return useContext(DashboardActiveContext);
|
|
}
|