feat(base): render table icon in sidebar for is_base=true pages

- Add isBase to SpaceTreeNode type
- Forward isBase from IPage in buildTree utility
- In the sidebar Node renderer, show IconTable when node.data.isBase
  is true and no custom emoji icon is set
This commit is contained in:
Philipinho
2026-04-27 01:50:05 +01:00
parent 19821d3aeb
commit 69e7bd73f2
3 changed files with 5 additions and 0 deletions
@@ -30,6 +30,7 @@ import {
IconPointFilled,
IconStar,
IconStarFilled,
IconTable,
IconTrash,
} from "@tabler/icons-react";
import {
@@ -422,6 +423,8 @@ function Node({ node, style, dragHandle, tree }: NodeRendererProps<any>) {
icon={
node.data.icon ? (
node.data.icon
) : node.data.isBase ? (
<IconTable size={18} />
) : (
<IconFileDescription size="18" />
)
@@ -7,6 +7,7 @@ export type SpaceTreeNode = {
spaceId: string;
parentPageId: string;
hasChildren: boolean;
isBase?: boolean;
canEdit?: boolean;
children: SpaceTreeNode[];
};
@@ -24,6 +24,7 @@ export function buildTree(pages: IPage[]): SpaceTreeNode[] {
hasChildren: page.hasChildren,
spaceId: page.spaceId,
parentPageId: page.parentPageId,
isBase: page.isBase,
canEdit: page.canEdit ?? page.permissions?.canEdit,
children: [],
};