feat(react-components): Do not render snippets by default when complete is false
This commit is contained in:
parent
8de63bb446
commit
61a674f517
1 changed files with 2 additions and 1 deletions
|
@ -2,8 +2,9 @@
|
|||
import React from 'react'
|
||||
import { getProps } from './utils.mjs'
|
||||
|
||||
export const Snippet = ({ snippet }) => {
|
||||
export const Snippet = ({ snippet, settings }) => {
|
||||
if (!snippet?.anchor || !snippet.def) return null
|
||||
if (!settings[0].complete && !snippet.attributes.list?.['data-force']?.[0]) return null
|
||||
const snippetProps = {
|
||||
xlinkHref: '#' + snippet.def,
|
||||
x: snippet.anchor.x,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue