import React from "react"; import { ShapeConfig } from "konva/types/Shape"; export const createHTMLBox = ({ x = 0, y = 0, width = 0, height = 0, fill, stroke, strokeLeftColor = stroke, strokeTopColor = stroke, strokeRightColor = stroke, strokeBottomColor = stroke, strokeWidth = 0, strokeTopWidth = strokeWidth, strokeRightWidth = strokeWidth, strokeBottomWidth = strokeWidth, strokeLeftWidth = strokeWidth, key, strokeStyle = "solid", }: ShapeConfig) => { const commonProps = {}; width = width - Math.floor(strokeWidth); y = y - Math.ceil(strokeWidth / 2); const lines = [
,
, ,
,
, ]; return ( {lines} {fill && (
)} ); };