// @ts-nocheck import * as React from "react"; import { ReactSVG } from "react-svg"; import _ from "lodash"; import { EditorMode } from "@sc/modules/v2/Editor/types"; export enum ShapeTypes { CIRCLE, RECTANGLE, ELLIPSE, LINE, POLYLINE, POLYGON, PATH, POLYPATH, FILE, } interface ShapeProps { mode?: EditorMode; type: ShapeTypes; style?: any; data?: any[]; before?: Boolean; after?: Boolean; url?: string | undefined; } export const Shape: React.FC = ({ type, style, data, url }) => { if (type === ShapeTypes.CIRCLE) { return ; } if (type === ShapeTypes.RECTANGLE) { return ; } if (type === ShapeTypes.ELLIPSE) { return ; } if (type === ShapeTypes.LINE) { return ; } if (type === ShapeTypes.POLYLINE) { return ; } if (type === ShapeTypes.POLYGON) { return ; } if (type === ShapeTypes.PATH) { return ; } if (type === ShapeTypes.POLYPATH) { return data.map((p: any) => ); } if (type === ShapeTypes.FILE) { return ; } }; interface ShapesProps { mode?: EditorMode; children?: React.ReactNode; style?: any; data?: ShapeProps[]; clipPathId?: string; } export const Shapes: React.FC = ({ children, style, data, clipPathId, }) => { interface WrapProps { mode?: EditorMode; children: React.ReactNode; } const SVGWrap: React.FC = ({ children }) => ( {children} ); const Wrap: React.FC = ({ children }) => (
{children}
); interface RSProps { mode?: EditorMode; data: ShapeProps[]; filter: string; type?: ShapeTypes; } const RenderShapes: React.FC = ({ data, filter, type }) => data .filter((itm: any) => itm[filter] && (type ? itm.type === type : true)) .map((shape: any) => ); if (clipPathId) return ( ); if (!data) return {children}; return (
{children &&
{children}
}
); }; export default Shapes;