File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
packages/app/src/app/hooks Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ import { useAppState } from 'app/overmind' ;
2+
3+ export type ActiveTeamInfo = {
4+ id : string | null ;
5+ name : string | null ;
6+ sdkWorkspace : boolean ;
7+ frozen : boolean ;
8+ } ;
9+
10+ /**
11+ * Hook to access active team information.
12+ *
13+ * This hook provides an abstraction layer over the Overmind state,
14+ * making it easier to migrate away from Overmind in the future.
15+ *
16+ * @returns Active team information or null values if no team is active
17+ */
18+ export const useActiveTeamInfo = ( ) : ActiveTeamInfo => {
19+ const { activeTeamInfo } = useAppState ( ) ;
20+
21+ if ( ! activeTeamInfo ) {
22+ return {
23+ id : null ,
24+ name : null ,
25+ sdkWorkspace : false ,
26+ frozen : false ,
27+ } ;
28+ }
29+
30+ return {
31+ id : activeTeamInfo . id ,
32+ name : activeTeamInfo . name ,
33+ sdkWorkspace : activeTeamInfo . sdkWorkspace ?? false ,
34+ frozen : activeTeamInfo . frozen ,
35+ } ;
36+ } ;
37+
You can’t perform that action at this time.
0 commit comments