mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
added placeholders
This commit is contained in:
parent
44ab426915
commit
b4b138e90f
16 changed files with 239 additions and 117 deletions
|
@ -5,15 +5,20 @@ import { formatTextParagraphs } from '~/utils/dom';
|
|||
import { path } from 'ramda';
|
||||
import styles from './styles.module.scss';
|
||||
import { useGotoNode } from '~/utils/hooks/node/useGotoNode';
|
||||
import { Paragraph } from '~/components/placeholders/Paragraph';
|
||||
|
||||
const LabText: FC<INodeComponentProps> = ({ node }) => {
|
||||
const LabText: FC<INodeComponentProps> = ({ node, isLoading }) => {
|
||||
const content = useMemo(() => formatTextParagraphs(path(['blocks', 0, 'text'], node) || ''), [
|
||||
node.blocks,
|
||||
]);
|
||||
|
||||
const onClick = useGotoNode(node.id);
|
||||
|
||||
return (
|
||||
return isLoading ? (
|
||||
<div className={styles.wrap}>
|
||||
<Paragraph lines={5} />
|
||||
</div>
|
||||
) : (
|
||||
<Markdown
|
||||
dangerouslySetInnerHTML={{ __html: content }}
|
||||
className={styles.wrap}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue