1
0
Fork 0
freesewing/packages/react/components/Pattern/grid.mjs
joostdecock 22a89f12d3 feat(dev): Added react docs for Pattern + refactor
This adds support for not only documenating components, but also
constants and functions that may be exported next to components.
2025-05-25 16:29:57 +02:00

21 lines
571 B
JavaScript

import React from 'react'
/**
* A component to render the grid for a paperless FreeSewing pattern' stack
*
* @component
* @param {object} props - All component props
* @param {Stack} props.stack - The FreeSewing Stack object for the pattern
* @param {string} props.stackName - The name of the FreeSewing Stack
* @returns {JSX.Element}
*/
export const Grid = ({ stack, stackName }) => (
<rect
x={stack.topLeft.x}
y={stack.topLeft.y}
width={stack.width}
height={stack.height}
className="grid"
fill={'url(#grid-' + stackName + ')'}
/>
)