// eslint-disable-next-line no-unused-vars import React, { forwardRef } from 'react' import { defaultPatternComponents } from '../pattern/index.mjs' // Components that can be swizzled import { PointXray } from './point.mjs' import { PathXray } from './path.mjs' /* * Allow people to swizzle these components */ export const defaultPatternXrayComponents = { ...defaultPatternComponents, Point: PointXray, Path: PathXray, } export const PatternXray = forwardRef( ( { renderProps = false, t = (string) => string, components = {}, children = false, className = 'freesewing pattern', }, ref ) => { if (!renderProps) return null // Merge default and swizzled components components = { ...defaultPatternXrayComponents, ...components, } const { Svg, Defs, Stack, Group } = components const optionalProps = {} if (className) optionalProps.className = className return ( {children ? children : Object.keys(renderProps.stacks).map((stackName) => ( ))} ) } ) PatternXray.displayName = 'PatternXray'