1
0
Fork 0
freesewing/sites/shared/components/workbench/menu/xray/path.js

35 lines
917 B
JavaScript
Raw Normal View History

2022-07-12 21:07:42 +02:00
import { Ul, Li, NoSumDiv, Deg } from 'shared/components/workbench/menu'
2022-06-17 12:02:09 +02:00
import { formatMm } from 'shared/utils'
import Attributes from './attributes'
import Ops from './path-ops'
2022-01-29 19:27:14 +01:00
2022-01-30 15:14:44 +01:00
const XrayPath = ({ pathName, partName, draft, t, units }) => {
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>
<span dangerouslySetInnerHTML={{
__html: formatMm(path.length(), units)
}} />
</NoSumDiv>
</Li>
<Ops ops={path.ops} />
</Ul>
)
}
2022-01-29 18:24:36 +01:00
export default XrayPath