mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
14 lines
362 B
TypeScript
14 lines
362 B
TypeScript
import type { Page, Workspace } from '@blocksuite/store';
|
|
import { useMemo } from 'react';
|
|
|
|
export function useBlockSuiteWorkspaceHelper(blockSuiteWorkspace: Workspace) {
|
|
return useMemo(
|
|
() => ({
|
|
createPage: (pageId?: string): Page => {
|
|
return blockSuiteWorkspace.createPage({ id: pageId });
|
|
},
|
|
}),
|
|
[blockSuiteWorkspace]
|
|
);
|
|
}
|