1
- import { Admin , Database , Home , Trash2 } from '@teable/icons' ;
2
- import { useOrganization } from '@teable/sdk/hooks' ;
1
+ import { Admin , Database , Home , Settings , Trash2 } from '@teable/icons' ;
2
+ import { useSession } from '@teable/sdk/hooks' ;
3
3
import { cn } from '@teable/ui-lib/shadcn' ;
4
4
import { Button } from '@teable/ui-lib/shadcn/ui/button' ;
5
5
import Link from 'next/link' ;
@@ -13,7 +13,8 @@ export const SpaceSideBar = (props: { isAdmin?: boolean | null }) => {
13
13
const { isAdmin } = props ;
14
14
const router = useRouter ( ) ;
15
15
const { t } = useTranslation ( spaceConfig . i18nNamespaces ) ;
16
- const { organization } = useOrganization ( ) ;
16
+ const { user } = useSession ( ) ;
17
+ const organization = user ?. organization ;
17
18
18
19
const pageRoutes : {
19
20
href : string ;
@@ -31,17 +32,17 @@ export const SpaceSideBar = (props: { isAdmin?: boolean | null }) => {
31
32
text : t ( 'space:sharedBase.title' ) ,
32
33
Icon : Database ,
33
34
} ,
34
- {
35
- href : '/admin/setting' ,
36
- text : t ( 'noun.adminPanel' ) ,
37
- Icon : Admin ,
38
- hidden : ! isAdmin ,
39
- } ,
40
35
{
41
36
href : `/enterprise/${ organization ?. id } ` ,
42
37
text : t ( 'noun.organizationPanel' ) ,
43
38
Icon : Admin ,
44
- hidden : ! organization ?. isAdmin ,
39
+ hidden : ! organization ,
40
+ } ,
41
+ {
42
+ href : '/admin/setting' ,
43
+ text : t ( 'noun.adminPanel' ) ,
44
+ Icon : Settings ,
45
+ hidden : ! isAdmin ,
45
46
} ,
46
47
{
47
48
href : '/space/trash' ,
0 commit comments