Create shapes square + circle + ....

This commit is contained in:
hamid zarghami
2025-11-18 15:31:09 +03:30
parent 9b06c7dfc5
commit 3f18ac62fa
9 changed files with 239 additions and 50 deletions
@@ -3,6 +3,8 @@ import type { EditorObject } from "../../store/editorStore";
import {
RectangleShape,
CircleShape,
TriangleShape,
AbstractShape,
TextShape,
LineShape,
ArrowShape,
@@ -41,6 +43,15 @@ const ObjectRenderer = ({
switch (obj.type) {
case "rectangle":
if (obj.shapeType === "circle") {
return <CircleShape key={obj.id} {...commonProps} />;
}
if (obj.shapeType === "triangle") {
return <TriangleShape key={obj.id} {...commonProps} />;
}
if (obj.shapeType === "abstract") {
return <AbstractShape key={obj.id} {...commonProps} />;
}
return <RectangleShape key={obj.id} {...commonProps} />;
case "circle":
return <CircleShape key={obj.id} {...commonProps} />;