feat: unify workspace sidebar and create Foundry graph pages
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import type { Board } from "./workspace";
|
||||
|
||||
export function readDemoBoards(workspace: string): Board[] {
|
||||
try {
|
||||
const stored = JSON.parse(localStorage.getItem("endoleap_demo_boards_" + workspace) || "null");
|
||||
if (Array.isArray(stored)) return stored.map((board) => ({
|
||||
...board, workspace_id: workspace, kind: "board", version: board.version || 1,
|
||||
}));
|
||||
} catch { /* Fall back to the sample pages when browser storage is invalid. */ }
|
||||
return [
|
||||
{ id: "morning", title: "城市清晨" },
|
||||
{ id: "ideas", title: "灵感收集" },
|
||||
{ id: "journey", title: "下一站,去哪里" },
|
||||
].map((board) => ({ ...board, workspace_id: workspace, kind: "board", version: 1 }));
|
||||
}
|
||||
Reference in New Issue
Block a user