import React, { useState } from 'react'
import {
withinPartBounds,
defaultComponents as patternComponents,
} from '@freesewing/react/components/Pattern'
import { H5, H6 } from '@freesewing/react/components/Heading'
import { KeyVal } from '@freesewing/react/components/KeyVal'
import { round } from '@freesewing/utils'
export const PointXray = ({
stackName,
pointName,
part,
point,
settings,
components,
strings,
drillProps = {},
}) => {
// Don't include parts outside the part bounding box
if (!withinPartBounds(point, part)) return null
const { info = {} } = drillProps
/*
* We use the Point component from Pattern here
* If we would extract Point from the components passed down,
* we'd create a recursion loop as the Point we call below
* would be this very PointXray component.
*/
const { Point } = patternComponents
return (
<>
{pointName}
of {stackName}