mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
refactored lab
This commit is contained in:
parent
d0e99adc9f
commit
b551fc44ea
41 changed files with 80 additions and 79 deletions
|
@ -2,7 +2,6 @@ import { createElement, FC, useCallback, useMemo } from 'react';
|
|||
|
||||
import {
|
||||
NodeComponentProps,
|
||||
LAB_PREVIEW_LAYOUT,
|
||||
NODE_COMPONENTS,
|
||||
NODE_HEADS,
|
||||
NODE_INLINES,
|
||||
|
@ -43,15 +42,5 @@ export const useNodeBlocks = (node: INode, isLoading: boolean) => {
|
|||
[node, createNodeBlock],
|
||||
);
|
||||
|
||||
const lab = useMemo(
|
||||
() =>
|
||||
node?.type && prop(node.type, LAB_PREVIEW_LAYOUT)
|
||||
? prop(node.type, LAB_PREVIEW_LAYOUT).map((comp, i) =>
|
||||
createNodeBlock(comp, i),
|
||||
)
|
||||
: undefined,
|
||||
[node, createNodeBlock],
|
||||
);
|
||||
|
||||
return { head, block, inline, lab };
|
||||
return { head, block, inline };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue