1
0
Fork 0

feat(react-components): Do not render snippets by default when complete is false

This commit is contained in:
joostdecock 2023-09-06 08:57:57 +02:00
parent 8de63bb446
commit 61a674f517

View file

@ -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,