1
0
Fork 0
freesewing/packages/freesewing.shared/components/workbench/draft/path/index.js

18 lines
512 B
JavaScript
Raw Normal View History

2022-01-25 11:22:09 +01:00
import TextOnPath from '../text-on-path'
import { getProps } from '../utils'
const Path = (props) => {
if (!props.path.render) return null
const output = []
const pathId = 'path-' + props.part + '-' + props.name
output.push(
<path id={pathId} key={pathId} d={props.path.asPathstring()} {...getProps(props.path)} />
)
if (props.path.attributes.get('data-text'))
output.push(<TextOnPath key={'text-on-path-' + props.name} pathId={pathId} {...props} />)
return output
}
export default Path