2023-09-29 18:20:28 +02:00
|
|
|
// __SDEFILE__ - This file is a dependency for the stand-alone environment
|
2023-06-07 10:06:30 -05:00
|
|
|
// eslint-disable-next-line no-unused-vars
|
2023-06-01 18:28:22 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { getId, getProps } from './utils.mjs'
|
|
|
|
|
2023-06-07 10:06:30 -05:00
|
|
|
export const Path = ({ stackName, pathName, path, partName, settings, components, t }) => {
|
2023-06-01 18:28:22 +02:00
|
|
|
// Don't render hidden paths
|
|
|
|
if (path.hidden) return null
|
|
|
|
|
|
|
|
// Get potentially swizzled components
|
|
|
|
const { TextOnPath } = components
|
|
|
|
|
|
|
|
const pathId = getId({ settings, stackName, partName, pathName })
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<path id={pathId} d={path.d} {...getProps(path)} />
|
2023-06-04 16:52:20 +02:00
|
|
|
{path.attributes.text && path.attributes.text.length > 0 ? (
|
|
|
|
<TextOnPath {...{ path, pathId, t }} />
|
|
|
|
) : null}
|
2023-06-01 18:28:22 +02:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|