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'
|
|
|
|
|
2025-04-01 16:15:20 +02:00
|
|
|
export const Path = ({ stackName, pathName, path, partName, settings, components, strings }) => {
|
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 ? (
|
2025-04-01 16:15:20 +02:00
|
|
|
<TextOnPath {...{ path, pathId, strings }} />
|
2023-06-04 16:52:20 +02:00
|
|
|
) : null}
|
2023-06-01 18:28:22 +02:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|