2023-02-05 17:59:22 +01:00
|
|
|
import { Ul, Li, NoSumDiv, Deg } from 'shared/components/workbench/menu/index.mjs'
|
|
|
|
import { formatMm } from 'shared/utils.mjs'
|
|
|
|
import Attributes from './attributes.mjs'
|
|
|
|
import Ops from './path-ops.mjs'
|
2022-01-29 19:27:14 +01:00
|
|
|
|
2023-02-05 19:58:25 +01:00
|
|
|
export const XrayPath = ({ pathName, partName, draft, units }) => {
|
2022-01-30 15:14:44 +01:00
|
|
|
const path = draft?.parts?.[partName]?.paths?.[pathName]
|
2022-01-29 18:24:36 +01:00
|
|
|
|
2022-02-08 20:49:19 +01:00
|
|
|
if (!path) return null
|
2022-01-30 15:14:44 +01:00
|
|
|
return (
|
|
|
|
<Ul>
|
2022-02-12 15:23:37 +01:00
|
|
|
<Attributes attr={path.attributes} />
|
2022-01-30 15:14:44 +01:00
|
|
|
<Li>
|
|
|
|
<NoSumDiv>
|
|
|
|
<Deg />
|
|
|
|
<span className="font-bold mr-2">path.render =</span>
|
2022-02-12 15:23:37 +01:00
|
|
|
<span>{JSON.stringify(path.render)}</span>
|
2022-01-30 15:14:44 +01:00
|
|
|
</NoSumDiv>
|
|
|
|
</Li>
|
|
|
|
<Li>
|
|
|
|
<NoSumDiv>
|
|
|
|
<Deg />
|
|
|
|
<span className="font-bold mr-2">path.length() =</span>
|
2023-02-05 17:59:22 +01:00
|
|
|
<span
|
|
|
|
dangerouslySetInnerHTML={{
|
|
|
|
__html: formatMm(path.length(), units),
|
|
|
|
}}
|
|
|
|
/>
|
2022-01-30 15:14:44 +01:00
|
|
|
</NoSumDiv>
|
|
|
|
</Li>
|
|
|
|
<Ops ops={path.ops} />
|
|
|
|
</Ul>
|
|
|
|
)
|
|
|
|
}
|