Yehoshua Sandler 1631271b93
Replace native canvas implementation with Konva library (#2)
* style: spelling

* refact: canvases replaced with konva

* refact: area text calculated by words

* refact: moved konva files out of test dir
2023-06-27 08:42:44 -05:00

31 lines
549 B
TypeScript

'use client'
import React from 'react'
import { Rect, } from 'react-konva'
type Props = {
rect: {
startX: number,
startY: number,
endX: number,
endY: number,
},
}
const DrawingArea = (props: Props) => {
const { rect } = props
const width = rect.endX - rect.startX
const height = rect.endY - rect.startY
return <Rect
width={width}
height={height}
x={rect.startX}
y={rect.startY}
strokeEnabled
stroke='#dc8dec'
strokeWidth={2}
strokeScaleEnabled={false}
/>
}
export default DrawingArea